Skip to content

mogulla3/autosave.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autosave.nvim

Provide autosave functionality to Neovim.

Inspired by vim-auto-save.

Installation

packer.nvim

use { "mogulla3/autosave.nvim" }

vim-plug

Plug "mogulla3/autosave.nvim"

Usage

All you have to do is call the setup() function.

require('autosave').setup()

Configuration

Some behaviors are customizable.

-- default settings
require('autosave').setup({
  enabled = true,
  silent = false,
  autosave_events = { "InsertLeave", "TextChanged", "CursorHold" },
  postsave_hook = nil,
})

enabled (type: boolean)

Default: true

If true, autosave is enabled.

silent (type: boolean)

Default: false

If true, no message is output during autosave.

autosave_events (type: table)

Default: { "InsertLeave", "TextChanged", "CursorHold" }

Events that perform autosave.

If you want to enable autosave even while in INSERT mode, you may additionally specify CursorHoldI and CompleteDone.

See :help events for more information about events.

postsave_hook (type: function)

Default: nil

Specify the process you want to perform after auto save as a lua function.

Commands

Several useful commands are built-in.

Command Description
:AutosaveEnable Enable autosave.
:AutosaveDisable Disable autosave.
:AutosaveToggle Toggle autosave.

About

A Neovim plugin that provide autosave functionality.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages