Skip to content

Instantly share code, notes, and snippets.

@delba
Created July 23, 2013 15:20
Show Gist options
  • Select an option

  • Save delba/6063223 to your computer and use it in GitHub Desktop.

Select an option

Save delba/6063223 to your computer and use it in GitHub Desktop.
toggle between number and relative number in vim
set nonumber
set relativenumber
function! ToggleNumber()
if &relativenumber
set number
set norelativenumber
else
set nonumber
set relativenumber
endif
endfunction
nnoremap <C-n> :call ToggleNumber()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment