aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-25 00:16:20 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-25 00:16:20 +1200
commitd2922f922a793cac6d5d39411dcd33f8f7a0a5af (patch)
treeb979a36b63f66cd7b886739a26d608683115cc6c
parentAdjust order of .vimrc (diff)
downloaddotfiles-d2922f922a793cac6d5d39411dcd33f8f7a0a5af.tar.gz
dotfiles-d2922f922a793cac6d5d39411dcd33f8f7a0a5af.zip
Save a different path for 'viminfo' file
-rw-r--r--vim/vimrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 130fe16f..56ee3d51 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -191,6 +191,14 @@ if has('persistent_undo')
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
+if exists('+viminfofile') " Use the new method if we can (v8.1.716)
+ let &viminfofile = $MYVIM.'/viminfo'
+else " Use old method instead; it works fine, it's just a bit clunky
+ execute 'set viminfo+=n'.escape($MYVIM.'/viminfo', '\ ')
+endif
+
" Let me move beyond buffer text in visual block mode
set virtualedit+=block