Last active
December 14, 2015 04:49
-
-
Save kwstannard/5030824 to your computer and use it in GitHub Desktop.
vimrc relative numbering. Leaves relative numbering on loss of focus and on entering insert mode. Re-enters when appropriate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set relativenumber | |
au InsertEnter * :set number | |
au InsertLeave * :set relativenumber | |
function! FocusGainNumbering() | |
if(mode() == 'i') | |
:set number | |
else | |
:set relativenumber | |
endif | |
endfunc | |
au FocusLost * :set number | |
au FocusGained * :call FocusGainNumbering() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment