How do I get vim to show trailing whitespace, but use blank spaces for tabs?

3

1

I want trailing whitespace to show as ., and tabs to show as blank spaces instead of ^I. I thought the solution would be easy:

set listchars=tab:  ,trail:.
set list

but that doesn't quite work:

Error detected while processing .vimrc:
line 11:
E474: Invalid argument: listchars=tab:

I suppose I have to escape or encode the whitespace somehow, but how?

David Smith

Posted 2012-08-20T05:32:43.577

Reputation: 133

Answers

9

 set listchars=tab:\ \ ,trail:.

akira

Posted 2012-08-20T05:32:43.577

Reputation: 52 754

Just so this is clear to anyone else: whatever the character you need to escape is, put a backslash before it, and a backslash and a space after it, before the comma. – shadowhand – 2014-04-16T22:15:06.383