NeoSave is a Neovim plugin that automatically saves your files as you edit, ensuring your progress is preserved. Configure NeoSave to save either the current buffer or all open buffers, and easily toggle auto-saving on and off.
- Save all open buffers or only the current buffer.
- Auto-save files upon modification.
- Toggle auto-saving off and on.
NeoSave remembers the auto-save state across sessions.
NeoSave is enabled by default. To toggle it off and on for specific files, see below.
To toggle NeoSave off and on, you can use the ToggleNeoSave
command:
:ToggleNeoSave
You can also create a keybinding to toggle NeoSave more conveniently:
vim.keymap.set("n", "<leader>s", "<cmd>ToggleNeoSave<cr>", { noremap = true, silent = true })
To clear the list of disabled files, you can use the ClearNeoSave
command:
:ClearNeoSave
- Install via your favorite package manager.
{
"ecthelionvi/NeoSave.nvim",
opts = {}
},
use "ecthelionvi/NeoSave.nvim"
- Setup the plugin in your
init.lua
. This step is not needed with lazy.nvim ifopts
is set as above.
require("NeoSave").setup()
Pass your config table into the setup() function or opts with lazy.nvim.
The available options:
write_all_bufs
(boolean): save all open buffers or only the current buffer- false (default)
local config = {
write_all_bufs = false,
}