vim: use plugin numbertoggle

master
Guillaume DOTT 2013-03-07 10:12:55 +01:00
parent 1288237939
commit 852169a618
1 changed files with 5 additions and 15 deletions

View File

@ -27,6 +27,7 @@ if filereadable(expand("$HOME/.vim/bundle/vundle/README.md"))
Bundle 'goldfeld/vim-seek' Bundle 'goldfeld/vim-seek'
Bundle 'Lokaltog/vim-easymotion' Bundle 'Lokaltog/vim-easymotion'
Bundle 'ton/vim-bufsurf' Bundle 'ton/vim-bufsurf'
Bundle 'jeffkreeftmeijer/vim-numbertoggle'
Bundle 'airblade/vim-gitgutter' Bundle 'airblade/vim-gitgutter'
Bundle 'tpope/vim-fugitive' Bundle 'tpope/vim-fugitive'
@ -136,8 +137,6 @@ map <F11> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" Rot13 " Rot13
map <F12> ggVGg? map <F12> ggVGg?
nnoremap <silent> <leader>r :call NumberToggle()<CR>
nnoremap <silent> ,bp :bprevious<CR> nnoremap <silent> ,bp :bprevious<CR>
nnoremap <silent> ,bf :bnext<CR> nnoremap <silent> ,bf :bnext<CR>
nnoremap <silent> ,Bp :BufSurfBack<CR> nnoremap <silent> ,Bp :BufSurfBack<CR>
@ -146,6 +145,8 @@ nnoremap <silent> ,Bf :BufSurfForward<CR>
" PLUGINS " PLUGINS
" { " {
" numbertoggle
let g:NumberToggleTrigger = "<leader>r"
" Session " Session
let g:session_autoload = 'no' let g:session_autoload = 'no'
let g:session_autosave = 'no' let g:session_autosave = 'no'
@ -221,15 +222,6 @@ function! ToggleYesNo()
exec "normal! \"_ciw\<C-R>=w\<CR>\<Esc>b" exec "normal! \"_ciw\<C-R>=w\<CR>\<Esc>b"
endif endif
endfunc endfunc
" NumberToggle toggles between relative and absolute line numbers
function! NumberToggle()
if(&relativenumber == 1)
set number
else
set relativenumber
endif
endfunc
" } " }
" MISC " MISC
@ -240,8 +232,6 @@ highlight clear SignColumn
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\s\+$', -1) au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\s\+$', -1)
" autocmd BufWrite * silent! %s/[\r \t]\+$// " autocmd BufWrite * silent! %s/[\r \t]\+$//
autocmd WinLeave * set number autocmd WinLeave * :call FocusLost()
autocmd WinEnter * set relativenumber autocmd WinEnter * :call FocusGained()
autocmd InsertEnter * set number
autocmd InsertLeave * set relativenumber
" } " }