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
|
||||
|
||||
" Autosave settings
|
||||
function SaveIfExist()
|
||||
if @% != "" && filereadable(@%)
|
||||
write
|
||||
endif
|
||||
endfunction
|
||||
set autowrite
|
||||
autocmd InsertLeave * save
|
||||
autocmd InsertLeave * call SaveIfExist()
|
||||
|
||||
" Search options
|
||||
set hlsearch
|
||||
|
Loading…
Reference in New Issue
Block a user