changeset 206:dae926f52b9a

Some Vim tweaks.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 31 Aug 2014 16:30:37 -0700
parents 9ecffad709b3
children d482e6144d52
files vim/vimrc
diffstat 1 files changed, 30 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/vim/vimrc	Sun Aug 31 16:29:35 2014 -0700
+++ b/vim/vimrc	Sun Aug 31 16:30:37 2014 -0700
@@ -239,13 +239,19 @@
 
 " }}}
 
+" Autotags {{{
+
+let g:autotags_exclude = ['venv', 'build', 'static', 'node_modules']
+
+" }}}
+
 " Syntastic {{{
 
 " Use `pyflakes` with `syntastic`.
-let g:syntastic_python_checkers = ['pyflakes']
-let g:syntastic_mode_map = {
-            \'mode': 'active',
-            \'passive_filetypes': []}
+"let g:syntastic_python_checkers = ['pyflakes']
+"let g:syntastic_mode_map = {
+"            \'mode': 'active',
+"            \'passive_filetypes': []}
 
 " }}}
 
@@ -257,7 +263,7 @@
             \}
 
 " Make the annotate window better in Lawrencium.
-let g:lawrencium_annotate_width_offset = 0
+let g:lawrencium_annotate_width_offset = 1
 
 " }}}
 
@@ -379,7 +385,6 @@
 " Ctrl-P mappings.
 nnoremap <silent> <C-p> :CtrlP<cr>
 nnoremap <silent> <C-o> :CtrlPBuffer<cr>
-nnoremap <silent> <C-i> :CtrlPBufTag<cr>
 nnoremap <silent> <C-u> :CtrlPTag<cr>
 nnoremap <silent> <C-y> :CtrlPQuickfix<cr>
 nnoremap <silent> <Tab> :CtrlPMRUFiles<cr>
@@ -417,6 +422,25 @@
 vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o>
 vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR><c-o>
 
+" Jump to tags by keeping things better in view. Option for jumping to a tag
+" in a split window where everything is folded except what you need to see.
+function! JumpToTag()
+    execute "normal! \<c-]>zz"
+endfunction
+function! JumpToTagInSplit()
+    execute "normal! \<c-w>v\<c-]>zMzvzz"
+endfunction
+nnoremap <c-]> :silent! call JumpToTag()<cr>
+nnoremap <c-\> :silent! call JumpToTagInSplit()<cr>
+
+" Keep search matches in the middle of the window.
+nnoremap n nzzzv
+nnoremap N Nzzzv
+
+" Same when jumping around
+nnoremap g; g;zz
+nnoremap g, g,zz
+
 " }}}
 
 " Abbreviations {{{