简体   繁体   English

如何显示 <TAB> 作为vim中的条

[英]How can I display <TAB> as bars in vim

I want to know is it possible to display the <tab> as | 我想知道是否可以将<tab>显示为|。 (bars) when coding in vim like this 像这样在vim中编码时 图片 Are there any ways to show them. 有什么方法可以显示它们。

Please any solution other than set listchars and set list as it affects eol and spaces. 请使用除set listcharsset list以外的任何其他解决方案,因为它会影响eol和空格。

:set list
:set lcs=tab:\|\  " the last character is space!

The tab setting consists of two characters: | tab设置包括两个字符: | and a space. 和一个空间。 The first character is used once. 第一个字符使用一次。 The second character is repeated to fill the space that the tab normally occupies. 重复第二个字符以填充制表符通常占用的空间。 See :h lcs . 参见:h lcs

Sample result: 样本结果:

在此处输入图片说明

However, setting the second character to space is not very helpful, as it is difficult to distinguish spaces followed by a tab, for instance. 但是,将第二个字符设置为空格不是很有用,因为例如很难区分空格和制表符。 Consider changing it to another character, eg: 考虑将其更改为另一个字符,例如:

:set list listchars=tab:\|\-

Sample result: 样本结果:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM