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() " }