comparison vim/vimrc @ 294:8bc056d80c39

Remove unused stuff, add grepping, shorter status line.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 02 Apr 2015 08:00:31 -0700
parents aac9b5b1f921
children 01ec865443b6
comparison
equal deleted inserted replaced
293:e2a48fb5e143 294:8bc056d80c39
447 nnoremap <C-l>s :call <SID>ToggleSpellCheck()<cr> 447 nnoremap <C-l>s :call <SID>ToggleSpellCheck()<cr>
448 448
449 " Simple way to close a buffer without closing the window. 449 " Simple way to close a buffer without closing the window.
450 nnoremap <leader>bd :bprevious<cr>:bdelete #<cr> 450 nnoremap <leader>bd :bprevious<cr>:bdelete #<cr>
451 451
452 " File-type switching.
453 nnoremap <leader>ftmd :set ft=markdown<cr>
454
455 " Use sane regexes. 452 " Use sane regexes.
456 nnoremap / /\v 453 nnoremap / /\v
457 vnoremap / /\v 454 vnoremap / /\v
458 455
459 " Next/previous quickfix and location messages. 456 " Next/previous quickfix and location messages.
470 nnoremap ]c ]czvzz 467 nnoremap ]c ]czvzz
471 nnoremap [c [czvzz 468 nnoremap [c [czvzz
472 469
473 " Quick search and replace. 470 " Quick search and replace.
474 function! s:VSetSearch() 471 function! s:VSetSearch()
475 let temp = @@ 472 let temp = @@
476 norm! gvy 473 norm! gvy
477 let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g') 474 let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
478 let @@ = temp 475 let @@ = temp
479 endfunction 476 endfunction
480 vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o> 477 vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o>
481 vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR><c-o> 478 vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR><c-o>
479
480 nnoremap <leader>fa :vimgrep /<C-R><C-W>/
481 vnoremap <leader>fa "zy:vimgrep /<C-R>z/
482 482
483 " Jump to tags by keeping things better in view. Option for jumping to a tag 483 " Jump to tags by keeping things better in view. Option for jumping to a tag
484 " in a split window where everything is folded except what you need to see. 484 " in a split window where everything is folded except what you need to see.
485 function! JumpToTag() 485 function! JumpToTag()
486 execute "normal! \<c-]>zvzz" 486 execute "normal! \<c-]>zvzz"
549 set statusline+=/ 549 set statusline+=/
550 set statusline+=%{&ft} " Type (python). 550 set statusline+=%{&ft} " Type (python).
551 set statusline+=) 551 set statusline+=)
552 552
553 " Line and column position and counts. 553 " Line and column position and counts.
554 set statusline+=\ (line\ %l\/%L,\ col\ %03c) 554 set statusline+=\ (%l\/%L,%03c)
555 555
556 " }}} 556 " }}}
557 557
558 " Functions {{{ 558 " Functions {{{
559 559