autosave.nvim is a Neovim and Vim plugin that provides automatic saving functionality. It allows you to toggle autosave on and off, check the current autosave status, and customize the plugin's behavior.
This plugin requires Vim >= 8.2.3288 with +lua
or Neovim >= 0.9
Using lazy.nvim (recommended) 💤
require("lazy").setup({
{
"brianhuster/autosave.nvim",
event="InsertEnter",
opts = {} -- Configuration here
},
})
rocks.nvim 🪨
:Rocks install live-preview.nvim
vim-plug 🔌
Plug 'brianhuster/autosave.nvim'
Native package (without a plugin manager) 📦
- Neovim
git clone --depth 1 https://github.com/brianhuster/live-preview.nvim ~/.local/share/nvim/site/pack/brianhuster/start/live-preview.nvim
- Vim
git clone --depth 1 https://github.com/brianhuster/live-preview.nvim ~/.vim/pack/brianhuster/start/live-preview.nvim
To toggle autosave on and off, you can use the :AutoSave toggle
command. This command will enable autosave if it's currently disabled, and disable it if it's currently enabled.
To check the current autosave status, you can use the :AutoSave status
command. This command will display a notification indicating whether autosave is currently enabled or disabled.
- Vimscript
g:autosave_enabled = v:true " Enable autosave when the plugin is loaded. Set to v:false to disable autosave, and only enable it when you run the :AutoSave toggle command.
- Lua
require("autosave").setup({
enabled = true, -- Enable autosave when the plugin is loaded. Set to false to disable autosave, and only enable it when you run the :AutoSave toggle command.
})
If you encounter any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request on this GitHub repository.