Create a gist now

Instantly share code, notes, and snippets.

@mattoc /.vimrc
Created Oct 11, 2012

What would you like to do?
Show line numbers in vim based on terminal size
" 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