aboutsummaryrefslogtreecommitdiff
path: root/vim/config/undo.vim
blob: f85d9d8cae36c77ecc41a445895a7ba24480da6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
" Rebind Ctrl-C in insert mode to undo the current insert operation
inoremap <C-c> <C-c>u

" Keep screeds of undo history
set undolevels=2000

" 'undodir' and 'undofile' settings will be taken care of by the
" auto_undodir.vim plugin if applicable/possible
if has('persistent_undo')

  " Turn off the option by default
  set noundofile

  " Don't keep undo files from temporary directories or shared memory in case
  " they're secrets
  if has('autocmd')
    augroup dotfiles_undo_skip
      autocmd!
      autocmd BufWritePre
            \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
            \ setlocal noundofile
    augroup END
  endif

endif