Browse Source

Store .swp files on a SDGish user-specific place: ~/.local/share/vim

Alois Mahdal 10 years ago
parent
commit
fc4bfd865f
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      dotfiles/vim/vimrc

+ 16
- 0
dotfiles/vim/vimrc View File

@@ -98,3 +98,19 @@ set autoindent
98 98
 
99 99
 set pastetoggle=<F4>
100 100
 nmap <F3> :set invnumber<CR>
101
+
102
+
103
+" ###############################################################################
104
+" ## from http://stackoverflow.com/a/9528322/835945
105
+" ###############################################################################
106
+
107
+" Save your swp files to a less annoying place than the current directory.
108
+" If you have .vim-swap in the current directory, it'll use that.
109
+" Otherwise it saves it to ~/.vim/swap, ~/tmp or .
110
+if isdirectory($HOME . '/.local/share/vim') == 0
111
+  :silent !mkdir -p ~/.vim/swap >/dev/null 2>&1
112
+  endif
113
+  set directory=./.vim-swap//
114
+  set directory+=~/.local/share/vim//
115
+  set directory+=~/tmp//
116
+  set directory+=.