aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-25 02:23:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-25 02:23:52 +1200
commit124dfa9f44bbeb59d151c8007d9538477dae25e4 (patch)
treee99ef59d820d05df6d474d524ef058e0348380ba
parentMove leader definitions (diff)
downloaddotfiles-124dfa9f44bbeb59d151c8007d9538477dae25e4.tar.gz
dotfiles-124dfa9f44bbeb59d151c8007d9538477dae25e4.zip
Adjust 'viminfo' setting logic, add new env var
-rw-r--r--vim/vimrc9
1 files changed, 5 insertions, 4 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 3558a09c..416eece3 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -181,12 +181,13 @@ if has('persistent_undo') " v7.2.438
set undodir^=$MYVIM/cache/undo//
endif
-" Keep the viminfo file in the ~/.vim directory, mostly to stop history
-" getting clobbered when something runs Vim without using this file
+" Keep the viminfo file in the home Vim directory, mostly to stop history
+" getting clobbered when something runs Vim without using this vimrc
+let $VIMINFO = $MYVIM.'/viminfo'
if exists('+viminfofile') " Use new option method if we can (v8.1.716)
- let &viminfofile = $MYVIM.'/viminfo'
+ let &viminfofile = $VIMINFO
else " Resort to clunkier method with 'viminfo' option flag
- execute 'set viminfo+=n'.escape($MYVIM.'/viminfo', '\ ')
+ execute 'set viminfo+=n'.escape($VIMINFO, '\ ')
endif
" Let me move beyond buffer text in visual block mode