Closed wookayin closed 5 years ago
vim-numbertoggle works the other way around. It will turn rnu
off in insert mode, and will turn it on in normal mode. The plugin doesn’t touch nu
, as having both relative and absolute line numbers on results in hybrid line numbers, and it expects you to set that up yourself.
Removing relative line number toggling would essentially be the same as turning the plugin off. If you’re looking to toggle absolute line numbers, something like this should work:
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave,WinEnter * set nu
autocmd BufLeave,FocusLost,InsertEnter,WinLeave * set nonu
augroup END
Great plugin!
It would be great to have an option to disable relativenumber permanently in the current vim session.
Currently
:set relativenumber!
orset norelativenumber
would toggle or turn off the feature, but as we enter the buffer again this loses its effect, i.e. relativenumber gets turned on again. Sometimes one may want to disable it --- a configuration point might be needed.