[UPDATE][VIM] Number toggle without a plug-in
It's really just a few lines of really simple Vimscript.
This commit is contained in:
parent
a7bdded5c6
commit
c9a2b25a2c
2 changed files with 11 additions and 4 deletions
11
vim/.vim/plugin/numbertoggle.vim
Normal file
11
vim/.vim/plugin/numbertoggle.vim
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue