mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
vim: only autosave for existing files
This commit is contained in:
parent
61ca5b014b
commit
5c8faae56d
@ -34,8 +34,13 @@ set scrolloff=6
|
|||||||
set nojoinspaces
|
set nojoinspaces
|
||||||
|
|
||||||
" Autosave settings
|
" Autosave settings
|
||||||
|
function SaveIfExist()
|
||||||
|
if @% != "" && filereadable(@%)
|
||||||
|
write
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
set autowrite
|
set autowrite
|
||||||
autocmd InsertLeave * save
|
autocmd InsertLeave * call SaveIfExist()
|
||||||
|
|
||||||
" Search options
|
" Search options
|
||||||
set hlsearch
|
set hlsearch
|
||||||
|
Loading…
Reference in New Issue
Block a user