summaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-10-31 10:57:11 +0100
committerAnton Khirnov <anton@khirnov.net>2020-10-31 10:57:11 +0100
commit7457ce38c2b7c96fc896a7a868ce348eb29e48b8 (patch)
treea547503e01e45bd16136d950bf2e28788f5d7dd2 /vim
parent789516299c890e8cca4101fa793d6356c44ec66f (diff)
vim: configure hybrid (abs/rel) line numbers
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc7
1 files changed, 7 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 75d7191..c7660f5 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -90,3 +90,10 @@ function SetLineDiff()
diffupdate
redraw
endfunction
+
+" hybrid line numbers
+augroup numbertoggle
+ autocmd!
+ autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu | endif
+ autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
+augroup END