Created
August 21, 2012 19:54
-
-
Save joequery/3418841 to your computer and use it in GitHub Desktop.
Vim Toggle Relative Line Numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " use Ctrl+L to toggle the line number counting method | |
| function! g:ToggleNuMode() | |
| if &nu == 1 | |
| set rnu | |
| else | |
| set nu | |
| endif | |
| endfunction | |
| nnoremap <silent><C-L> :call g:ToggleNuMode()<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This wouldn't work for me--it would only toggle once, then C-L wouldn't work again. Here's how I made it work for me: