1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

toggle relative number based on autocmd events

This commit is contained in:
jdhao 2020-05-22 15:19:29 +08:00 committed by GitHub
parent 4c97952525
commit e5e38fb8ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,4 +50,10 @@ augroup auto_read
autocmd FileChangedShellPost * echohl WarningMsg
\ | echo "File changed on disk. Buffer reloaded!" | echohl None
augroup END
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
"}