Is there any way to make Vim/gVim highlight the right-margin at the current document? I have just begun to work with Vim for a while and I found it annoyed without the right-margin at column 80.
+5
A:
There's no simple way to visualize vertical line of textwidth
-margin. But you can highlight all symbols after position 80 on their lines:
:match ErrorMsg /\%>80v.\+/
So, general solution is to put in .vimrc
something like that:
:autocmd BufWinEnter * call matchadd('ErrorMsg', '\%>' . &l:textwidth . 'v.\+', -1)
(By the way, as an example of similar, but more complicated highlighting you could take a look at my answer to question http://stackoverflow.com/questions/2158305/is-it-possible-to-display-indentation-guides-in-vim).
ib
2010-02-02 08:09:12
Thank you, that does work :-).
CMPITG
2010-02-03 06:03:11