Easy toggle between different number modes in vim: nonumber
, absolute
and relative number
,
with just one key sequence to rule it all. Most other plugins don't provide a seamless way
to do all 3 modes at once.
http://www.vim.org/scripts/script.php?script_id=5249
If you use pathogen, clone the repo as below:
git clone https://github.com/tkhoa2711/vim-togglenumber.git ~/.vim/bundle/vim-togglenumber
After having your help tags regenerated, you can view the reference manual with :help togglenumber
.
Or the Vundle way: add the following line to your .vimrc
,
save it and then run :PluginInstall
.
Plugin 'tkhoa2711/vim-togglenumber'
By default, the plugin is triggered with <Leader>n
. However you can add your own
preferred mapping such as:
nnoremap <F6> :ToggleNumber<CR>
The standard numbering mode in vim is nonumber
. You may go for other options by
adding the following to your .vimrc
:
set number
or
set relativenumber
In case you have no idea about your <Leader>
key, or rarely use it, I'd recommend giving the
following setting a try, put this in your .vimrc
:
let mapleader = "\<Space>"
Then, invoking the <Space>n
key sequence would cycle through the modes effortlessly.
- Vim 7.3 or later
MIT License