vim: Move numbertoggle autocmd into settings.vim

Step by step I want to restructure the vim files. The approach to
cleanly divide the config by topics works in zsh pretty well, but is too
vague in vim for my liking.

Especially (the very small) functions and autocommands that have the
purpose of setting options or mapping keys or the interplay of multiple
categories together, make it difficult to decide in which file the
snippets should lay.
This commit is contained in:
2022-08-28 01:06:55 +02:00
parent b56eaa0eb2
commit ba3a54fc44
2 changed files with 5 additions and 6 deletions

View File

@@ -1,6 +1,11 @@
" Settings """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" hybrid linenumbers
set number relativenumber
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
" no timeout when exiting insert-mode
" (see https://www.johnhawthorn.com/2012/09/vi-escape-delays/)
set timeoutlen=1000 ttimeoutlen=0

View File

@@ -57,9 +57,3 @@ 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