comparison vim/vimrc @ 367:d8ae3de7de06

More Vim tweaks.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 16 Feb 2017 18:48:31 -0800
parents 2060d92ccc2f
children b87c358bd0ca
comparison
equal deleted inserted replaced
366:13e897e6a813 367:d8ae3de7de06
264 let g:ctrlp_extensions = [ 264 let g:ctrlp_extensions = [
265 \'tag', 'buffertag', 'quickfix', 'mixed', 'bookmarkdir', 265 \'tag', 'buffertag', 'quickfix', 'mixed', 'bookmarkdir',
266 \'autoignore' 266 \'autoignore'
267 \] 267 \]
268 268
269 " Use PyMatch to go faster.
270 if has('python') || has('python3')
271 let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'}
272 let g:ctrlp_max_files = 0
273 let g:ctrlp_lazy_update = 350
274 endif
275
269 " }}} 276 " }}}
270 277
271 " Gutentags {{{ 278 " Gutentags {{{
272 279
273 let g:gutentags_exclude = ['venv', 'build', 'static', 'node_modules'] 280 let g:gutentags_exclude = ['venv', 'build', 'static', 'node_modules']
412 noremap <up> g<up> 419 noremap <up> g<up>
413 noremap <down> g<down> 420 noremap <down> g<down>
414 noremap <home> g<home> 421 noremap <home> g<home>
415 noremap <end> g<end> 422 noremap <end> g<end>
416 423
424 noremap <S-up> 20<up>
425 noremap <S-down> 20<down>
426
417 " Tab navigation 427 " Tab navigation
418 noremap <C-Tab> :tabnext<cr> 428 noremap <C-Tab> :tabnext<cr>
419 noremap <C-S-Tab> :tabprevious<cr> 429 noremap <C-S-Tab> :tabprevious<cr>
420 nnoremap <leader>t :tabnew<cr> 430 nnoremap <leader>t :tabnew<cr>
421 nnoremap <C-t> :tabnew<cr> 431 nnoremap <C-t> :tabnew<cr>
493 nnoremap [q :cprevious<cr>zvzz 503 nnoremap [q :cprevious<cr>zvzz
494 nnoremap ]l :lnext<cr>zvzz 504 nnoremap ]l :lnext<cr>zvzz
495 nnoremap [l :lprevious<cr>zvzz 505 nnoremap [l :lprevious<cr>zvzz
496 506
497 " Same with change and jump lists. 507 " Same with change and jump lists.
498 nnoremap ]] g,zz 508 nnoremap ]e g,zz
499 nnoremap [[ g;zz 509 nnoremap [e g;zz
500 nnoremap ]j <C-I> 510 nnoremap ]j <C-I>
501 nnoremap [j <C-O> 511 nnoremap [j <C-O>
512
513 " Copy the current buffer's info.
514 nnoremap <leader>cp :let @+ = expand('%:p')<cr>
515 nnoremap <leader>cf :let @+ = expand('%:h')<cr>
502 516
503 " Make the diff navigation also center things. 517 " Make the diff navigation also center things.
504 nnoremap ]c ]czvzz 518 nnoremap ]c ]czvzz
505 nnoremap [c [czvzz 519 nnoremap [c [czvzz
506 520
521 " in a split window where everything is folded except what you need to see. 535 " in a split window where everything is folded except what you need to see.
522 " Note that if a tag search yield multiple possible results, we will still run 536 " Note that if a tag search yield multiple possible results, we will still run
523 " some of that `zvzz` stuff, but that's OK, the main point is to not mess up 537 " some of that `zvzz` stuff, but that's OK, the main point is to not mess up
524 " the result selection window either. 538 " the result selection window either.
525 nnoremap <F9> :pop<cr> 539 nnoremap <F9> :pop<cr>
526 nnoremap <F10> <c-]>zvzz 540 nnoremap <F10> :tj<cr>zvzz
527 nnoremap <s-F10> <c-w>v<c-]>zMzvzz 541 nnoremap <s-F10> <c-w>v:tj<cr>zMzvzz
528 nnoremap <c-F9> :tprevious 542 nnoremap <c-F9> :tprevious
529 nnoremap <c-F10> :tnext 543 nnoremap <c-F10> :tnext
530 544
531 " Keep search matches in the middle of the window. 545 " Keep search matches in the middle of the window.
532 nnoremap n nzvzz 546 nnoremap n nzvzz
533 nnoremap N Nzvzz 547 nnoremap N Nzvzz
534 548
535 " }}} 549 " }}}
536 550
537 " Folding {{{ 551 " Folding {{{
552
553 " Start with one level of open.
554 set foldlevel=1
538 555
539 " Folds are defined by markers in the text. 556 " Folds are defined by markers in the text.
540 set foldmethod=marker 557 set foldmethod=marker
541 558
542 " Toggle folds with <space>. 559 " Toggle folds with <space>.