在vim中美化制表符

6
我将尝试让vim的外观更加类似于我在Coda 2中使用的界面。
在我的 .vimrc 文件中,我有以下这行代码:
set listchars=tab:➝.,extends:#,nbsp:.

这使得我的空格看起来像这样:

enter image description here

然而,我更希望那些点不可见,这样它看起来更像这样:

enter image description here

我尝试使用空格字符,但最终出现了这个警告:

E474: Invalid argument: listchars=tab:➝

我可以使用不会显示在屏幕上,且不会引起警告的字符吗?
2个回答

8
您可以像这样转义空格字符:
set listchars=tab:➝\ ,extends:#,nbsp:.

4
在listchars中,tab:占用两个字符。直接从帮助文件中获取的信息:
  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.

所以,您可以使用空格代替您用于第二个字符的点,但必须进行转义:set listchars=tab:➝\ ,extends:#,nbsp:.,以获得所需的结果。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接