Created
October 11, 2012 00:50
-
-
Save mattoc/3869485 to your computer and use it in GitHub Desktop.
Show line numbers in vim based on terminal size
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
" I like having line numbers on, but don't want to wrap lines in a | |
" standard-sized terminal window. | |
fun! WinSizeAutoNumber() | |
if winwidth(0) > 84 | |
set number | |
else | |
set nonumber | |
endif | |
endfunction | |
" Run once on startup | |
call WinSizeAutoNumber() | |
" Run when window is resized | |
au VimResized * call WinSizeAutoNumber() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment