Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use listcharsin my .vimrcto see the whitespace. My current setting is :

set list listchars=nbsp:¤,tab:>-,trail:¤,extends:>,precedes:<

And that give to me, for example this :

>---Foo bar >---vim¤>---

But I would like this thing:

    Foo bar >---vim¤>---

But I don't know how to get this behavior.

Thank you.

share|improve this question
Don't use tabs for indenting. – romainl Dec 12 '12 at 6:58
up vote 0 down vote accepted

You can't. The 'listchars' setting applies globally; you cannot suppress it for parts of the buffer.

Alternatively, you could :set nolist and instead use custom matches (:match) to highlight the whitespace in the positions you want. But if you wanted replacement with different characters, not just different colors, you'd have to use :syntax together with the new conceal feature, but those additional syntax definitions may then interfere with the filetype's default syntax.

So in the end, the only way to really achieve this is through modifying Vim's sources and recompiling a custom version for you.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .