diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-04-24 11:36:39 +0300 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-04-24 11:36:39 +0300 |
| commit | 6bef8f32b19778fdfe52f0eb39719425508dcc7b (patch) | |
| tree | f293141ed7e8676b76bb06c07a0fa9472b10e2ac /.config/nvim/lua/custom/plugins/auto-save.lua | |
| parent | dbd9a6fdd0c44e26b200fb706aacd120a2e09c47 (diff) | |
Refactored nvim config to make it easier and less insanely nested
Diffstat (limited to '.config/nvim/lua/custom/plugins/auto-save.lua')
| -rw-r--r-- | .config/nvim/lua/custom/plugins/auto-save.lua | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/.config/nvim/lua/custom/plugins/auto-save.lua b/.config/nvim/lua/custom/plugins/auto-save.lua deleted file mode 100644 index 5da836b..0000000 --- a/.config/nvim/lua/custom/plugins/auto-save.lua +++ /dev/null @@ -1,33 +0,0 @@ -return { - 'okuuva/auto-save.nvim', - cmd = 'ASToggle', - event = { 'InsertLeave', 'TextChanged' }, - opts = function() - -- Disable autoformat between automatic saves - vim.api.nvim_create_autocmd('User', { - pattern = 'AutoSaveWritePre', - group = vim.api.nvim_create_augroup('autosave-pre', { clear = true }), - callback = function(opts) - local bufnr = opts.data.saved_buffer - vim.b[bufnr].disable_autoformat = true - end, - }) - - vim.api.nvim_create_autocmd('User', { - pattern = 'AutoSaveWritePost', - group = vim.api.nvim_create_augroup('autosave-post', { clear = true }), - callback = function(opts) - local bufnr = opts.data.saved_buffer - vim.b[bufnr].disable_autoformat = false - end, - }) - - return { - -- execution_message = { enabled = false }, removed - condition = function(buf) - -- Save only if the buffer is not a "special buffer" - return vim.fn.getbufvar(buf, '&buftype') == '' - end, - } - end, -} |
