]> git.rmz.io Git - dotfiles.git/commitdiff
persistent undo history
authorSamir Benmendil <samir.benmendil@gmail.com>
Wed, 16 Oct 2013 09:17:42 +0000 (11:17 +0200)
committerSamir Benmendil <samir.benmendil@gmail.com>
Wed, 16 Oct 2013 09:30:29 +0000 (11:30 +0200)
vimrc

diff --git a/vimrc b/vimrc
index 6a2047b18d90f4657835b9240be5aad4762dc616..13d2097d2b394688e79a6840c62ab30cf86cd12a 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -22,6 +22,13 @@ set wrap                       " wrap lines
 set linebreak                  " do not wrap in the middle of a word
 set showbreak=▒▒               " show these chars for wrapped lines
 
+" backup/undo {{{1
+set backup      " keep a backup file
+set backupdir=$HOME/.vim/backupdir
+
+set undofile    " persistent undo history
+set undodir=$HOME/.vim/backupdir
+
 " NERDTree {{{1
 " open/close NERDTree with \e
 nmap <Leader>e :NERDTreeToggle<CR>
@@ -41,14 +48,6 @@ let g:airline#extensions#tabline#enabled = 1
 :nmap <Leader>M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<CR>
 :nmap <Leader>m :set expandtab tabstop=2 shiftwidth=2 softtabstop=2<CR>
 
-" backup {{{1
-if has("vms")
-  set nobackup          " do not keep a backup file, use versions instead
-else
-  set backup            " keep a backup file
-  set backupdir=$HOME/.vim/backupdir
-endif
-
 " appearance {{{1
 set background=dark            " Dark background, d'uh!
 set number                     " show some linenumbers