Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim end of line

Tags:

vim

I want to view where lines end in gvim. I very often have spaces after statements and I don't want to have. How to toggle this editor feature?

like image 507
Mariy Avatar asked Jan 12 '11 13:01

Mariy


1 Answers

Use:

set list

That will show lots of stuff (see :help 'list' for more information). If you want to just show the line endings, do this as well:

set lcs=eol:$,tab:\ \ 

(Note that there are two "backslash, space" pairs on the end of the line). This prevents tabs from being highlighted.

You could alternatively do:

set lcs=eol:$,tab:\ \ ,trail:#

To make all trailing spaces as #. Play with it to your hearts content and see:

:help 'listchars'

Alternatively, you can just highlight it with something like this:

syn match Error /\s\+$/
like image 50
DrAl Avatar answered Oct 27 '22 06:10

DrAl