Added function to toggle relative line numbers

+ <leader>/ will toggle between relative and absolute line numbers
This commit is contained in:
Nick Nisi
2012-06-14 16:22:09 -05:00
parent 6a300385fb
commit 5f6086f9c2

View File

@@ -53,6 +53,7 @@ if has("autocmd")
autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
autocmd FileType ruby setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType html setlocal ts=4 sts=4 sw=4 expandtab
autocmd FileType jade setlocal ts=2 sts=2 sw=2 noexpandtab
"autocmd WinEnter * setlocal cursorline
"autocmd WinLeave * setlocal nocursorline
" automatically resize panes on resize
@@ -290,6 +291,16 @@ nnoremap <silent> k gk
" toggle paste
map <leader>v :set paste!<cr>
function! ToggleNuMode()
if (&rnu == 1)
set nu
else
set rnu
endif
endfunction
nnoremap <leader>/ :call ToggleNuMode()<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugins
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""