]> oss.titaniummirror.com Git - smckown/dotfiles.git/commitdiff
Relocate vim swap/backup/undo files
authorR. Steve McKown <rsmckown@gmail.com>
Mon, 8 Jun 2015 21:14:15 +0000 (15:14 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Mon, 8 Jun 2015 21:23:17 +0000 (15:23 -0600)
The location where swap/backup/undo files should be in a subdirectory of
a vim runtimepath, and one that is user specific.  The idea of using
something like the previous .local/shared/vim is too linux distro
specific.

Since MacVim and *nix vim both have $HOME/.vim in the runtimepath, then
this is the best place.  For Windows, we have to use $HOME/vimfiles
instead.

.gitignore
vim/vimrc

index ffe9657f0791ddd2f5b448c88c1d129222a007cc..2464a6497e488ae8e424d4beabfc0d1939dee5da 100644 (file)
@@ -1 +1,2 @@
-vim/.netrwhist
+/vim/.netrwhist
+/vim/tmp
index 68d687ef6d73e46999cac6e705f640799e3e4b52..a670f8625513ff8625a5c62e2e51dfce9bf11e17 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -90,9 +90,7 @@ endif
 " Setup swap/backup/undo
 " Note that as of vim 7.4, backupdir // will not expand backup files to a full
 " path as is the case with directory and undodir.
-let s:dir = expand(has('win32') ? '~/Application Data/Vim' : has('mac') ?
-  \ '~/Library/Vim' : '~/.local/share/vim')
-execute 'set directory^=' . s:dir . '/swap//'
+let s:dir = expand(has('win32') ? '$HOME/vimfiles' : '$HOME/.vim')
 if !isdirectory(s:dir . '/')
   call mkdir(s:dir)
 endif
@@ -105,6 +103,7 @@ endif
 if !isdirectory(s:dir . '/undo/')
   call mkdir(s:dir . '/undo')
 endif
+execute 'set directory^=' . s:dir . '/swap//'
 if isdirectory(s:dir . '/backup/')
   execute 'set backupdir=' . s:dir . '/backup//'
   set backup