vi: Display a vertical line at an arbitrary column width
set colorcolumn=80
Placing the above inside your .vimrc file will draw a vertical line inside vi. This is helpful if your coding style prefers to not have lines over a certain length.
Written by Scott Woodall
Related protips
3 Responses
I'm pretty sure this doesn't work in vi. Vim >= 7.3 only.
over 1 year ago
·
By the way, here's the generic version of config (doesn't not error if option is not present):
if exists('&colorcolumn')
set colorcolumn=80
endif
over 1 year ago
·
Extending on @dmedvinsky
if exists('+colorcolumn')
set colorcolumn=80
else
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%80v.\+', -1)
endif
will emulate colorcolumn by simply coloring the overflowing characters.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#