nvim: Automatically toggle between absolute and relative line numbers
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
parent
54e2176b0a
commit
517e7560cd
|
@ -265,6 +265,13 @@ endif
|
|||
"*****************************************************************************
|
||||
"" Autocmd Rules
|
||||
"*****************************************************************************
|
||||
"" Automatically switch between absolute and relative line numbers
|
||||
augroup numbertoggle
|
||||
autocmd!
|
||||
autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif
|
||||
autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
|
||||
augroup END
|
||||
|
||||
"" The PC is fast enough, do syntax highlight syncing from start unless 200 lines
|
||||
augroup vimrc-sync-fromstart
|
||||
autocmd!
|
||||
|
|
Reference in a new issue