vim:autocmd: Disable relative numbers in insert
As relative line numbers are only really needed in normal mode and in the current buffer, disable them in insert mode or when the buffer/window is not focused.
This commit is contained in:
@@ -63,3 +63,9 @@ augroup highlight_current_word
|
||||
au CursorHold * :exec 'match CursorColumn /\V\<' . escape(expand('<cword>'), '/\') . '\>/'
|
||||
au CursorMoved * :exec 'match'
|
||||
augroup END
|
||||
|
||||
augroup numbertoggle
|
||||
au!
|
||||
au BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu | endif
|
||||
au BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
|
||||
augroup END
|
||||
|
||||
Reference in New Issue
Block a user