Set viminfofile to ~/.cache/vim/info

This commit is contained in:
Kenneth Benzie 2018-10-19 12:01:03 +01:00
parent 61599e0b05
commit d3a8920bf7

View File

@ -37,7 +37,7 @@ if &listchars ==# 'eol:$'
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
endif
if v:version > 703 || v:version == 703 && has("patch541")
if v:version > 703 || v:version == 703 && has('patch541')
" Delete comment character when joining commented lines
set formatoptions+=j
endif
@ -105,6 +105,15 @@ if has('writebackup')
set nowritebackup
endif
" Change info file location
if has('viminfo') && has('unix')
let s:cache_dir = expand('~/.cache/vim')
if !isdirectory(s:cache_dir)
call mkdir(s:cache_dir)
endif
execute 'set viminfofile='.s:cache_dir.'/info'
endif
" Use Unix as standard file type
set fileformats=unix,mac,dos