aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-18 10:13:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-18 10:13:30 +1200
commitfcc0e387b0f4ae02a07b6c721066749161f9444f (patch)
tree7f53be591bd7ee03f60d28bc26fec9831b756bf1 /vim
parentCheck b:is_posix existence not value (diff)
downloaddotfiles-fcc0e387b0f4ae02a07b6c721066749161f9444f.tar.gz
dotfiles-fcc0e387b0f4ae02a07b6c721066749161f9444f.zip
Scrap auto_cache_dirs plugin for a new approach
Trying this instead; creating the relevant directories at install time. Also putting all three under one "cache" subdir of ~/.vim or ~/vimfiles. I'm not sure this is actually better, but I do like that the relevant options are now set in the .vimrc rather than in a plugin, so I guess we'll see.
Diffstat (limited to 'vim')
m---------vim/bundle/auto_cache_dirs0
-rw-r--r--vim/vimrc40
2 files changed, 40 insertions, 0 deletions
diff --git a/vim/bundle/auto_cache_dirs b/vim/bundle/auto_cache_dirs
deleted file mode 160000
-Subproject 70ce18086dcd84044b307d1481ae8651b9edd4a
diff --git a/vim/vimrc b/vim/vimrc
index c8e219f1..e6ff3c77 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -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