diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | Makefile | 8 | ||||
m--------- | vim/bundle/auto_cache_dirs | 0 | ||||
-rw-r--r-- | vim/vimrc | 40 |
4 files changed, 47 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules index bad6f54b..093f1fc4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,4 @@ # My Vim plugins -[submodule "vim/bundle/auto_cache_dirs"] - path = vim/bundle/auto_cache_dirs - url = https://sanctum.geek.nz/code/vim-auto-cache-dirs.git [submodule "vim/bundle/big_file_options"] path = vim/bundle/big_file_options url = https://sanctum.geek.nz/code/vim-big-file-options.git @@ -548,11 +548,17 @@ install-vim-bundle: install-vim-config 'cp -p -- "$$1" $(VIMDIR)/"$${1#vim/bundle/*/}"' _ {} \; $(VIM) -e -u NONE -c 'helptags $(VIMDIR)/doc' -c quit +install-vim-cache: + mkdir -p -- \ + $(VIMDIR)/cache/backup \ + $(VIMDIR)/cache/swap \ + $(VIMDIR)/cache/undo + install-vim-compiler: mkdir -p -- $(VIMDIR)/compiler cp -p -- vim/compiler/*.vim $(VIMDIR)/compiler -install-vim-config: +install-vim-config: install-vim-cache cp -p -- vim/vimrc $(VIMRC) if [ -e /etc/debian_version ] ; then \ cp -p -- vim/system/debian.vim $(VIMDIR)/system.vim ; \ diff --git a/vim/bundle/auto_cache_dirs b/vim/bundle/auto_cache_dirs deleted file mode 160000 -Subproject 70ce18086dcd84044b307d1481ae8651b9edd4a @@ -50,6 +50,13 @@ set backspace+=eol " Line breaks set backspace+=indent " Spaces from 'autoindent' set backspace+=start " The start of current insertion +" Try to keep swapfiles in one system-appropriate dir +if has('unix') + set directory^=~/.vim/cache/undo +elseif has('win32') || has('win64') + set directory^=~/vimfiles/cache/undo +endif + " How to deal with lines wrapping beyond the last screen row if v:version > 704 || v:version == 704 && has('patch2109') set display=truncate " Show '@@@' on the last line, if supported @@ -105,6 +112,24 @@ set shortmess+=I " Give me a bit longer to complete mappings set timeoutlen=3000 +" Backup settings +if has('backup') + + " Do keep backups + set backup + + " Try to keep them all in one system-appropriate dir, with full path + if has('unix') + set backupdir^=~/.vim/cache/backup// + elseif has('win32') || has('win64') + set backupdir^=~/vimfiles/cache/backup// + endif + + " Don't back up stuff in /dev/shm or /var/tmp + set backupskip+=/dev/shm,/var/tmp + +endif + " Clear default 'comments' value, let the filetype handle it if has('comments') set comments= @@ -142,6 +167,21 @@ if has('mksession') set sessionoptions-=options endif +" Persistent undo settings +if has('persistent_undo') + + " Do keep undo files + set undofile + + " Try to keep them all in one system-appropriate dir + if has('unix') + set undodir^=~/.vim/cache/undo// + elseif has('win32') || has('win64') + set undodir^=~/vimfiles/cache/undo// + endif + +endif + " Let me move beyond buffer text in visual block mode if has('virtualedit') set virtualedit+=block |