aboutsummaryrefslogtreecommitdiff
path: root/vim/config/undo.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/config/undo.vim')
-rw-r--r--vim/config/undo.vim22
1 files changed, 6 insertions, 16 deletions
diff --git a/vim/config/undo.vim b/vim/config/undo.vim
index c9539665..c31780e7 100644
--- a/vim/config/undo.vim
+++ b/vim/config/undo.vim
@@ -4,23 +4,13 @@ inoremap <C-c> <C-c>u
" Keep screeds of undo history
set undolevels=2000
-" Keep undo history in a separate file if the feature is available, we're on
-" Unix, and not using sudo(8); this goes really well with undo visualization
-" plugins like Gundo or Undotree.
-if !strlen($SUDO_USER) && has('unix') && has('persistent_undo')
+" 'undodir' and 'undofile' settings will be taken care of by the
+" auto_undodir.vim plugin if applicable/possible
+if has('persistent_undo')
+ set noundofile
- " Keep per-file undo history in ~/.vim/undo; the double-slash at the end
- " of the directory prods Vim into keeping the full path to the file in its
- " undo filename to avoid collisions; the same thing works for swap files
- set undofile
- set undodir^=~/.vim/undo//
-
- " Create the ~/.vim/undo directory if necessary and possible
- if !isdirectory($HOME . '/.vim/undo') && exists('*mkdir')
- call mkdir($HOME . '/.vim/undo', 'p', 0700)
- endif
-
- " Don't track changes to sensitive files
+ " Don't keep undo files from temporary directories or shared memory in case
+ " they're secrets
if has('autocmd')
augroup dotfiles_undo_skip
autocmd!