What is the Dollar sign ("$") at the end of every line in Vim

Viewed 27936

I am relatively new to Vim. Whenever I start Vim using vim LearnRuby.rb, a dollar sign appears at every line.

Why?

3 Answers

Obviously, the solution is not to :set nolist, as that also disables other characters like tabs and trailing spaces, which can be very useful. :set nolist would be the correct answer if you wanted all of the special characters gone.

If you just want a quick fix, you could add this to your vimrc instead:

set listchars+=eol:\ .

That is a backslash followed by a whitespace.

Alternatively you can set all the arguments of listchars, for exampleset listchars=tab:>\ ,trail:. and not include the eol argument, which determines the character used for end of line.

Refer to :h listhcars and :h list

Related