Skip to content

Instantly share code, notes, and snippets.

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
set nonumber
" 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