Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prettier tab symbols in vim

Tags:

vim

I’m trying to make vim look more similar to what I’m used to in Coda 2.

In my .vimrc I have this line:

set listchars=tab:➝.,extends:#,nbsp:.

That makes my whitespace look like this:

enter image description here

However, I’d rather those dots weren’t visible, so it’d look more like this:

enter image description here

I've tried using a space character, but I end up with this warning:

E474: Invalid argument: listchars=tab:➝

What character can I use that won’t be visible on the screen, and also won’t throw a warning?

like image 390
Jezen Thomas Avatar asked May 08 '13 11:05

Jezen Thomas


2 Answers

You can escape the space character like this:

set listchars=tab:➝\ ,extends:#,nbsp:.
like image 110
Lars Kotthoff Avatar answered Oct 26 '22 23:10

Lars Kotthoff


In listchars tab: takes to characters. Directly from the help file:

  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.

So you can just use a space instead of the dot that you are using for the second character, it does have to be escaped though: set listchars=tab:➝\ ,extends:#,nbsp:. to get the result you want.

like image 33
jbr Avatar answered Oct 27 '22 01:10

jbr