From 852169a618f26bd68318f0c86267e2bfd209f821 Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Thu, 7 Mar 2013 10:12:55 +0100 Subject: [PATCH] vim: use plugin numbertoggle --- vim/vimrc | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 1198048..2036db8 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -27,6 +27,7 @@ if filereadable(expand("$HOME/.vim/bundle/vundle/README.md")) Bundle 'goldfeld/vim-seek' Bundle 'Lokaltog/vim-easymotion' Bundle 'ton/vim-bufsurf' + Bundle 'jeffkreeftmeijer/vim-numbertoggle' Bundle 'airblade/vim-gitgutter' Bundle 'tpope/vim-fugitive' @@ -136,8 +137,6 @@ map :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . " Rot13 map ggVGg? -nnoremap r :call NumberToggle() - nnoremap ,bp :bprevious nnoremap ,bf :bnext nnoremap ,Bp :BufSurfBack @@ -146,6 +145,8 @@ nnoremap ,Bf :BufSurfForward " PLUGINS " { +" numbertoggle +let g:NumberToggleTrigger = "r" " Session let g:session_autoload = 'no' let g:session_autosave = 'no' @@ -221,15 +222,6 @@ function! ToggleYesNo() exec "normal! \"_ciw\=w\\b" endif endfunc - -" NumberToggle toggles between relative and absolute line numbers -function! NumberToggle() - if(&relativenumber == 1) - set number - else - set relativenumber - endif -endfunc " } " MISC @@ -240,8 +232,6 @@ highlight clear SignColumn au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\s\+$', -1) " autocmd BufWrite * silent! %s/[\r \t]\+$// -autocmd WinLeave * set number -autocmd WinEnter * set relativenumber -autocmd InsertEnter * set number -autocmd InsertLeave * set relativenumber +autocmd WinLeave * :call FocusLost() +autocmd WinEnter * :call FocusGained() " }