sponsor Vim development Vim logo Vim Book Ad

AutoSave : Automatically persist a buffer frequently.

 script karma  Rating 0/0, Downloaded by 55  Comments, bugs, improvements  Vim wiki

created by
Ingo Karkat
script type
When developing scripts or programs, one frequently switches between a short
edit in Vim and a test or compiler run in a terminal. If one forgets to
persist the changes in Vim (:w), that run is of no avail, and one has to
switch back to Vim, save, and repeat.

This plugin allows to designate certain buffers for automatic persistence when
GVIM (and Vim in terminals that support the FocusLost event) lose focus, or
optionally also when 'updatetime' passes without a keypress in Vim. With that,
you can just make your edits, switch to another application, and the changes
will have been saved to the file, regardless of whether that file was
currently active inside Vim.

- The todo.txt has an entry for an 'autosave' option, which would persist a
  buffer shortly after the last change.
- vim-auto-save (vimscript #4521) automatically persists _all_ (toggled with
  :AutoSaveToggle) buffers on CursorHold events (and reduces 'updatetime' to
  200 ms).

:AutoSave[!], :NoAutoSave
                        Turn on / off automatic saving of the current buffer
                        whenever Vim loses focus (in the GUI) or exits; with !
                        also on CursorHold.
install details
The code is hosted in a Git repo at
You can use your favorite plugin manager, or "git clone" into a directory used
for Vim packages. Releases are on the "stable" branch, the latest unstable
development snapshot on "master".

This script is also packaged as a vimball. If you have the "gunzip"
decompressor in your PATH, simply edit the *.vmb.gz package in Vim; otherwise,
decompress the archive first, e.g. using WinZip. Inside Vim, install by
sourcing the vimball or via the :UseVimball command.
    vim AutoSave*.vmb.gz
    :so %
To uninstall, use the :RmVimball command.

- Requires Vim 7.0 or higher.
- Requires the ingo-library.vim plugin (vimscript #4433), version 1.016 or

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
AutoSave-1.00.vmb.gz 1.00 2017-11-13 7.0 Ingo Karkat Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo