[UPDATE][VIM] Number toggle without a plug-in

It's really just a few lines of really simple Vimscript.
This commit is contained in:
Bruno BELANYI 2019-10-13 17:19:43 +02:00
parent a7bdded5c6
commit c9a2b25a2c
2 changed files with 11 additions and 4 deletions

View file

@ -0,0 +1,11 @@
" Idea for toggling taken from jeffkreeftmeijer
" Show line numbers
set number
augroup numbertoggle
autocmd!
" Toggle numbers between relative and absolute when changing buffers
autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu | endif
autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
augroup END