From a3b9e27e9100c1dbaf32124f629f1d84b7818f96 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 12 Jan 2016 14:05:27 +0100 Subject: [PATCH] Persistant undo, my saviour --- vimrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vimrc b/vimrc index 815ff14..902bb36 100644 --- a/vimrc +++ b/vimrc @@ -199,6 +199,20 @@ filetype on filetype plugin on filetype indent on +" Put plugins and dictionaries in this dir (also on Windows) +let vimDir = '$HOME/.vim' +let &runtimepath.=','.vimDir + +" Keep undo history across sessions by storing it in a file +if has('persistent_undo') + let myUndoDir = expand(vimDir . '/undodir') + " Create dirs + call system('mkdir ' . vimDir) + call system('mkdir ' . myUndoDir) + let &undodir = myUndoDir + set undofile +endif + map map map