aboutsummaryrefslogtreecommitdiff
path: root/vim/config/swapfile.vim
blob: de0598c20f1713d2c70c008fda10765d1f73e814 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
" Default to no swap files at all, in a way that even ancient/tiny Vims will
" understand; the auto_cache_dirs.vim plugin will take care of re-enabling
" this with a 'directory' setting
set noswapfile

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