Highlight right margin in vim
September 9, 2009 2:15 PM   Subscribe

VIMfilter: I want to change the background color of every column past 80. What I don't want is softwrap.

Found tons of solutions like these:
:highlight rightMargin ctermfg=lightblue
:match rightMargin /.\%>79v/
Which is kind of what I want, except it only highlights lines that have content in them. I want to highlight all lines, even if the content doesn't extend that far.

Exactly like in TextMate when you turn on "Show right margin indicator" and "Highlight right margin".
posted by sbutler to Computers & Internet (5 answers total) 3 users marked this as a favorite
 
Best answer: Since you have to use a match command to assign a highlight scheme, vim can only change the display colors (foreground or background) of blocks that contain characters.
posted by pmbuko at 2:38 PM on September 9, 2009


Best answer: I don't think this is possible. On short lines, those columns don't really exist to Vim, so it can't highlight them.
posted by zsazsa at 2:41 PM on September 9, 2009


Best answer: http://vim.wikia.com/wiki/Highlight_long_lines says zsazsa has it right.
posted by d. z. wang at 7:57 PM on September 9, 2009


Try
:set nowrap
for turning off softwrap? ( apologies if not applicable )
posted by HannoverFist at 9:19 PM on September 9, 2009


Response by poster: Damn; I guess vim can't do everything. Thanks guys.
posted by sbutler at 10:40 PM on September 9, 2009


« Older Where did you play, Patzer?   |   Overwhelmed with life insurance options Newer »
This thread is closed to new comments.