How to use multiple spaces in listchars?

2

1

I'm currently using the following listchars I found on vim casts:

set listchars=tab:▸\ ,eol:¬

I'd like to make tab be ▸ followed by 3 spaces, but I can't seem to get it to work. I've tried the following:

set listchars=tab:▸\ \ \ ,eol:¬
set listchars=tab:▸\   ,eol:¬
set listchars=tab:▸<Space><Space><Space>,eol:¬

All throw errors. Is this possible?

Alex S

Posted 2014-03-13T00:22:57.817

Reputation: 235

Answers

2

No, this is not possible. :help 'listchars' explicitly states that the tab portion of the option must be exactly two characters:

tab:xy  Two characters to be used to show a tab.  The first
        char is used once.  The second char is repeated to
        fill the space that the tab normally occupies.
        "tab:>-" will show a tab that takes four spaces as
        ">---".  When omitted, a tab is show as ^I.

Heptite

Posted 2014-03-13T00:22:57.817

Reputation: 16 267

5

The visible width of the <Tab> character with :set list is determined by the (variable) width that the character normally occupies. If you want to ensure that a (full) tab is represented by your symbol and 3 spaces, just make sure that the tab width is 4 characters:

:set ts=4

Ingo Karkat

Posted 2014-03-13T00:22:57.817

Reputation: 19 513