From d3a8920bf78f5e3923ced073af92a8c8ea07946e Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 19 Oct 2018 12:01:03 +0100 Subject: [PATCH] Set viminfofile to ~/.cache/vim/info --- plugin/settings.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugin/settings.vim b/plugin/settings.vim index 20edaeb..50e0983 100644 --- a/plugin/settings.vim +++ b/plugin/settings.vim @@ -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