Automatically save changes to disk
No Data
AutoSave - automatically save changes to disk without having to use
:w(or any binding to it) every time a buffer has been modified.
Inspired by the same feature in RubyMine text editor.
Use vundle or download packaged version from vim.org.
AutoSave is disabled by default, run
:AutoSaveToggleto enable/disable it.
g:auto_saveoption:
" .vimrc let g:auto_save = 1 " enable AutoSave on Vim startup
AutoSave relies on
CursorHoldevent and sets the
updatetimeoption to 200 so that modifications are saved almost instantly.
updatetimeoption may affect other plugins and break things.
updatetimewith
g:auto_save_no_updatetimeoption:
" .vimrc let g:auto_save_no_updatetime = 1 " do not change the 'updatetime' option
You can disable AutoSave in insert mode with the
g:auto_save_in_insert_modeoption:
" .vimrc let g:auto_save_in_insert_mode = 0 " do not save while in insert mode
AutoSave will display on the status line on each auto-save by default.
(AutoSaved at 08:40:55)
You can silence the display with the
g:auto_save_silentoption:
" .vimrc let g:auto_save_silent = 1 " do not display the auto-save notification
If you need an autosave hook (such as generating tags post-save) then use
g:auto_save_postsave_hookoption:
" .vimrc let g:auto_save_postsave_hook = 'TagsGenerate' " this will run :TagsGenerate after each save
Development is made in 907th/vim-auto-save repo.
Feel free to contribute!
Distributed under the MIT License (see LICENSE.txt).
Copyright (c) 2013-2014 Alexey Chernenkov