Skip to content

A simple Neovim and Vim plugin for autosaving as you type

License

Notifications You must be signed in to change notification settings

rootiest/autosave.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autosave.nvim

LuaRocks

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.

Installation

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

Usage

Enabling and Disabling Autosave

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.

Checking Autosave Status

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.

Configuration

  • 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.
})

Contributing

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.

About

A simple Neovim and Vim plugin for autosaving as you type

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 63.0%
  • Vim Script 37.0%