diff --git a/.vimrc b/.vimrc index 595b197..8cb1c94 100644 --- a/.vimrc +++ b/.vimrc @@ -163,8 +163,6 @@ nnoremap :bprev " Saner CTRL-L " https://github.com/mhinz/vim-galore#saner-ctrl-l nnoremap dh :nohlsearch:diffupdate:syntax sync fromstart -" toggle linenumbers -nnoremap z :set nonu! " toggle cursorline nnoremap h :set nocursorline! " strg+f sucht fuzzy nach dateien @@ -189,3 +187,12 @@ vnoremap sr y:%s/"//gc " ### Abbreviations iabbrev ncicht nicht iabbrev nciht nicht + +" linenumbers +nnoremap z :set nonumber! norelativenumber! +" https://jeffkreeftmeijer.com/vim-number/ +: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