aboutsummaryrefslogtreecommitdiff
path: root/autocommands.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autocommands.vim')
-rw-r--r--autocommands.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/autocommands.vim b/autocommands.vim
index ef86138..f46a06c 100644
--- a/autocommands.vim
+++ b/autocommands.vim
@@ -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
"}