Anonymous,
October 25, 2004 23:31
|
just set the linebreak character/string to mark wrapped lines, e.g.
:set showbreak=NEWLINE:
or
:set showbreak=>
You may need to set other flags like linebreak, textwidth, etc..
Thomas
|
[email protected],
October 27, 2004 14:12
|
Nitin, is 'textwidth' a variable you have to set? Your command highlights every line in the file.
|
Anonymous,
October 27, 2004 17:38
|
I have tried but it highlights everything. Do I need a certain setup for this ?
|
Anonymous,
October 27, 2004 22:12
|
Those who find that every line is highlighted probably have textwidth set to 0
For details see:-
:help textwidth
My own mod was to add a conditional check and only highlight if textwidth was > 0
au BufEnter * if &textwidth; > 0 | exec 'match Todo /\%>' . &textwidth; . 'v.\+/' | endif
Note this runs on BufEnter for all files.
|
[email protected],
October 28, 2004 5:55
|
Is it possible to draw a red line at the 80th column? I don't like the text marked but it would be nice to see that the line is too long.
Sven
|
Anonymous,
October 28, 2004 7:51
|
Textwidth must be set before your setting, right ? When I set, e.g. tw=80 manually after entering the buffer, highlighting does not work, unfortunately. If I set it before, it works as expected. Any hint how to make a kind of refresh ?
|
Anonymous,
October 28, 2004 9:11
|
This will force Vim to execute the autocommand manually:-
:set tw=80 | do BufEnter
See :help *autocmd-execute*
-Frank.
|
Eric Boucher,
November 2, 2004 15:47
|
If you want to highlight only the 80th column with a search for example, you can do:
/.\{79}\zs.
This will 'draw' a vertical line on the 80th caracter on all the lines which have 80 caracters or more. You can map this one for a fast highlighting.
|
Anonymous,
November 28, 2004 9:26
|
Don't get over complex, there is a search designed to do exactly this:
Highlight all characters at column #81 (all longer than 80 characters)
\%81c
Highlight all characters from column #81 to the end of the line.
\%>81c
I have those searches mapped to keys, but you could just as easily add them to a syntax file or a highlight/match pattern.
|
Anonymous,
January 28, 2007 17:00
|
note that the 'c' after \%80 means that the 80th character gets matched and that tabs are characters also... so if you for example write a program and use tabs to indent your code, this is probably not what you want, especially if you are going to print the code later.
use 'v' instead in this case.
|