Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I can change the eol character of all lines except the active one by

hi nonText ctermfg=2

However, I do not know how to change the eol character of the line where my cursor is.

How can you highlight the eol character of an active line?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

EOL characters are under the NonText highlighting group. However, the ones on the current line conform to the Normal and Cursorline group, if you have CursorLine turned on. If you don't, there's no problem, EOL goes with the NonText group. If you do, you can modify CursorLine group, but not much, cause you'll be changing the entire current line highlighting.

share|improve this answer
1  
+1 cos this sounds about right and should answer the question (at least explain why it can't be done) –  David Pashley Jun 7 '09 at 7:41

I'm not sure how to answer your question -- I don't think control characters like that can be highlighted.

I do know that they can be search-and-replaced easily. In the case of the ^M EOL character, I usually use :%s/ctrl-Vctrl-M//g

share|improve this answer
    
-1 because this doesn't answer the question. Useful, yes, relevent, not so much. –  David Pashley Jun 7 '09 at 7:42

If you simply want to see the eol character use the following command:

:set list

This will show tabs and eol characters. The default character representation for eol is the '$' character. This can be changed with the 'lcs' command if you want. To turn this off simply use the command:

:set nolist

Also, if you want to read more about this command you need to type:

:help nolist

The 'set list' command shows the eol character on all lines, i.e. the active and non-active lines both in control and in editing modes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.