" All addons managed via pathogen
filetype off
runtime bundle/vim-pathogen/autoload/pathogen.vim
-call pathogen#infect('bundle/{}')
+call pathogen#infect()
call pathogen#helptags()
" This .vimrc depends upon the sensible plugin for proper operation.
endif
endif
-" jellybeans is a nice dark scheme same for vim/xterm and gvim
-colors nuvola
+colors lucius
" Local listchars def if utf-8 terminal. Otherwise sensible defaults are OK.
if &termencoding ==# 'utf-8' || &encoding ==# 'utf-8'
autocmd BufNewFile,BufRead *.plt,*.gnnuplot setf gnuplot
endif
-" Turn off backup and undo files if the proper dirs in ~/.local are not present.
-let s:dir = has('win32') ? '~/Application Data/Vim' : has('mac') ? '~/Library/Vim' : '~/.local/share/vim'
-if !isdirectory(expand(s:dir) . '/backup/')
+" 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//'
+if !isdirectory(s:dir . '/')
+ call mkdir(s:dir)
+endif
+if !isdirectory(s:dir . '/swap/')
+ call mkdir(s:dir . '/swap')
+endif
+if !isdirectory(s:dir . '/backup/')
+ call mkdir(s:dir . '/backup')
+endif
+if !isdirectory(s:dir . '/undo/')
+ call mkdir(s:dir . '/undo')
+endif
+if isdirectory(s:dir . '/backup/')
+ execute 'set backupdir=' . s:dir . '/backup//'
+ set backup
+else
set nobackup
endif
-if !isdirectory(expand(s:dir) . '/undo/') && exists('+undofile')
+if has('persistent_undo') && isdirectory(s:dir . '/undo/')
+ execute 'set undodir=' . s:dir . '/undo//'
+ set undofile
+else
set noundofile
endif