sponsor Vim development Vim logo Vim Book Ad

basic Tip #935: Highlight space errors

 tip karma   Rating 11/8, Viewed by 1428 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   May 26, 2005 7:52      complexity:   basic
author:   S. Walderich      as of Vim:   6.0

To highlight spaces at the end of a line and spaces in front of tabs you can simply add the following command to your vimrc:
let <language>_space_errors=1
supported languages are:
ada, c, chill, csc, icon, java, lpc, mel, nqc, nroff, ora, plm, plsql and python. So if you want to highlight space errors in lpc-files you have to write:
let lpc_space_errors=1

If you don't want to see the errors at the end of the line set:
let <language>_no_trail_space_error=1
and if you only use spaces to indent and don't want to see the space errors in front of tabs set:
let <language>_no_tab_space_error=1

 rate this tip  Life Changing Helpful Unfulfilling 

<< Vim-sessions under Windows | Quick insert character at end-of-line >>

Additional Notes

Anonymous, May 26, 2005 18:02
Also see tip #396.
Bertram Scharpf, May 27, 2005 0:23
My tip 878 didn't actually rate high, but at least its answers could be seen as a nice summary of the possible opportunities.

I like very much the `listchars' trick with `tab' and `trail'.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge.net Logo