summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-03-02 01:51:51 -0500
committerJesse Luehrs <doy@tozt.net>2018-03-03 01:04:21 -0500
commitbee8a0affc5e35b023c1e54236118b51d60642ac (patch)
treeafd46d70cdac91ecab6294ea062fce42a5a715b0 /vim
parente28cb240b6a9aac81c6470c86ff0f0bc90301241 (diff)
downloadconf-bee8a0affc5e35b023c1e54236118b51d60642ac.tar.gz
conf-bee8a0affc5e35b023c1e54236118b51d60642ac.zip
use a separate swap dir for vim
Diffstat (limited to 'vim')
-rw-r--r--vim/plugin/opinionated-defaults.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/vim/plugin/opinionated-defaults.vim b/vim/plugin/opinionated-defaults.vim
index 7858182..db07888 100644
--- a/vim/plugin/opinionated-defaults.vim
+++ b/vim/plugin/opinionated-defaults.vim
@@ -20,6 +20,12 @@ if has('persistent_undo')
exe "set undodir=" . s:undocachedir
set undofile
endif
+" use a separate swapfile directory
+let s:swapfiledir = $HOME . '/.cache/vim/swap'
+if !isdirectory(s:swapfiledir)
+ call mkdir(s:swapfiledir, 'p')
+endif
+exe "set directory=" . s:swapfiledir
""" BUFFERS """