]> git.rmz.io Git - dotfiles.git/blobdiff - vim/vimrc
vim: separate backup, undo and view dir
[dotfiles.git] / vim / vimrc
index 231ebad8b0613b4b73338407ec91f316987fa0da..f7a072b60d866ac030a3133bf0bfafebfe611d96 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -28,7 +28,6 @@ Plugin 'scrooloose/syntastic'
 Plugin 'sirver/ultisnips'
 Plugin 'sjl/gundo.vim'
 Plugin 'tomtom/tcomment_vim'
 Plugin 'sirver/ultisnips'
 Plugin 'sjl/gundo.vim'
 Plugin 'tomtom/tcomment_vim'
-Plugin 'tpope/vim-endwise'
 Plugin 'tpope/vim-fugitive'
 Plugin 'tpope/vim-repeat'
 Plugin 'tpope/vim-surround'
 Plugin 'tpope/vim-fugitive'
 Plugin 'tpope/vim-repeat'
 Plugin 'tpope/vim-surround'
@@ -44,7 +43,9 @@ Plugin 'derekwyatt/vim-fswitch'
 " Plugin 'jalcine/cmake.vim'
 " Plugin 'powerman/vim-plugin-viewdoc'
 
 " Plugin 'jalcine/cmake.vim'
 " Plugin 'powerman/vim-plugin-viewdoc'
 
+" endwise needs to be after delimitmate
 Plugin 'raimondi/delimitmate'
 Plugin 'raimondi/delimitmate'
+Plugin 'tpope/vim-endwise'
 Plugin 'lokaltog/vim-easymotion'
 Plugin 'chrisbra/checkattach'
 Plugin 'klen/python-mode'
 Plugin 'lokaltog/vim-easymotion'
 Plugin 'chrisbra/checkattach'
 Plugin 'klen/python-mode'
@@ -168,19 +169,30 @@ set diffopt=filler,vertical
 " reading and writing files {{{2
 set modeline                    " read modelines
 set modelines=2                 " only check first/last 2 lines
 " reading and writing files {{{2
 set modeline                    " read modelines
 set modelines=2                 " only check first/last 2 lines
+
 set writebackup                 " write a backup file before overwriting a file
 set backup                      " keep a backup after owerwriting a file
 set writebackup                 " write a backup file before overwriting a file
 set backup                      " keep a backup after owerwriting a file
-set backupdir=$XDG_CACHE_HOME/vim//
+set backupdir=$XDG_CACHE_HOME/vim/backup//
+
+set backupskip+=.netrc          " skip netrc
+set backupskip+=/dev/shm/pass*  " skip passwordstore files
 
 set undofile                    " persistent undo history
 
 set undofile                    " persistent undo history
-set undodir=$XDG_CACHE_HOME/vim//
+set undodir=$XDG_CACHE_HOME/vim/undo//
+
+augroup undoskip
+    au!
+    au BufWritePre .netrc         setlocal noundofile
+    au BufWritePre /dev/shm/pass* setlocal noundofile
+    au BufWritePre /tmp/*         setlocal noundofile
+augroup END
 
 set autowrite                   " automatically write a file when leaving a modified buffer
 set autoread                    " automatically read a file that has been modified
 
 " the swap file {{{2
 set noswapfile
 
 set autowrite                   " automatically write a file when leaving a modified buffer
 set autoread                    " automatically read a file that has been modified
 
 " the swap file {{{2
 set noswapfile
-set directory=$XDG_CACHE_HOME/vim//
+set directory=$XDG_CACHE_HOME/vim/swap//
 
 " command line editing {{{2
 set history=5000                " how many command lines are remembered
 
 " command line editing {{{2
 set history=5000                " how many command lines are remembered
@@ -201,7 +213,7 @@ set wildignore+=*.orig                           " Merge resolution files
 set virtualedit=block           " let cursor move past last char in <C-V> mode
 set viminfo='100,<50,s10,h,n$XDG_CACHE_HOME/vim/viminfo " viminfo defaults but save file in .cache
 
 set virtualedit=block           " let cursor move past last char in <C-V> mode
 set viminfo='100,<50,s10,h,n$XDG_CACHE_HOME/vim/viminfo " viminfo defaults but save file in .cache
 
-set viewdir=$XDG_CACHE_HOME/vim
+set viewdir=$XDG_CACHE_HOME/vim/view//
 
 " autocmds {{{1
 " Resize splits when the window is resized {{{2
 
 " autocmds {{{1
 " Resize splits when the window is resized {{{2
@@ -393,6 +405,10 @@ let g:airline_powerline_fonts = 1
 " checkattach {{{2
 let g:checkattach_filebrowser = 'ranger'
 
 " checkattach {{{2
 let g:checkattach_filebrowser = 'ranger'
 
+" delimitmate {{{2
+let delimitMate_expand_cr = 2
+let g:delimitMate_expand_space = 1
+
 " fswitch {{{2
 nnoremap <silent> <Leader>ff :FSHere<CR>
 nnoremap <silent> <Leader>fl :FSRight<CR>
 " fswitch {{{2
 nnoremap <silent> <Leader>ff :FSHere<CR>
 nnoremap <silent> <Leader>fl :FSRight<CR>
@@ -433,7 +449,10 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTree
 " python-mode {{{2
 
 let g:pymode_rope_completion = 0
 " python-mode {{{2
 
 let g:pymode_rope_completion = 0
+let g:pymode_rope = 0
 let g:pymode_folding = 1
 let g:pymode_folding = 1
+let g:pymode_lint_ignore = "E221,E266,E501"
+let g:pymode_syntax_space_errors = 0    " don't bother me when I'm typing
 
 " synastic {{{2
 let g:syntastic_enable_highlighting = 0
 
 " synastic {{{2
 let g:syntastic_enable_highlighting = 0
@@ -526,19 +545,3 @@ nnoremap <silent> <Leader>s :call ToggleSpell()<CR>
 nnoremap <silent> <Leader>S :call SwitchSpell()<CR>
 " fix spelling with first choice
 nnoremap <Leader>f 1z=
 nnoremap <silent> <Leader>S :call SwitchSpell()<CR>
 " fix spelling with first choice
 nnoremap <Leader>f 1z=
-
-" Toggle line numbers {{{2
-function! g:ToggleNumber()
-    if !exists("b:relanum")
-        let b:relanum=1
-    endif
-    if &l:number
-        let b:relanum = &relativenumber
-        setlocal nonumber norelativenumber
-    else
-        let &l:relativenumber = b:relanum
-        setlocal number
-    endif
-endfunction
-nnoremap <silent><leader>n :call g:ToggleNumber()<cr>
-nnoremap <silent><leader>N :setlocal relativenumber!<cr>