在 gvim 中显示空白字符
有没有一种简单的方法可以在 gvim 中显示空格和制表符等空白字符?与 Gedit、Geany、Komodo 和其他 GUI 编辑器中实现的类似,其中(打开该选项时)空格显示为静音或灰色的“.”。和制表符为“-->”。
Is there an easy way to display whitespace characters such as space and tab in gvim? Something like what is implemented in Gedit, Geany, Komodo, and other GUI editors where (when the option is turned on) spaces show as a muted or greyed-out '.' and tabs as '-->'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看 Vim 中的
listchars
和list
选项。使用此功能的示例:Check out
listchars
andlist
options in Vim. An example use of this feature:如果您首先启用 Unicode,您可以使用任何您想要的字符
我使用的一行(放入
~/.vimrc
):了解有关此设置的更多信息 http://vim.wikia.com/wiki/Highlight_unwanted_spaces
这些字符的颜色由您的配色方案控制。
You can use any characters you wish if you enable Unicode first
One line I use (put in
~/.vimrc
):Learn more about this setting at http://vim.wikia.com/wiki/Highlight_unwanted_spaces
The color of these characters is controlled by your color scheme.
这是我的一些与空白相关的设置。
使用
F11
切换是否显示空白字符:设置
list
时如何显示空白字符:以黄色突出显示特殊字符:
突出显示多余空格(末尾的空格)行、制表符之前或之后的空格):
希望这些有所帮助!
Here are some of my settings pertaining whitespace.
Use
F11
to toggle between displaying whitespace characters or not:How to show whitespace characters when
list
is set:Highlight special characters in yellow:
Highlight redundant spaces (spaces at the end of the line, spaces before or after tabs):
Hope these help!
这对我来说效果很好:
This works well for me: