在vim中显示尾随空格 [英] Showing trailing spaces in vim

查看:103
本文介绍了在vim中显示尾随空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在.vimrc中设置了以下选项

I've set the following options in .vimrc

set listchars=tab:▸\ ,trail:·
set list

并且期望在代码中使用空格进行制表的那些地方看到点(我使用空格,而不是制表符). 但是,结果是不同的:

And expected to see dots in those places where spaces are used for tabulation in the code (I use spaces, not tabs). However, the result is different:

能否请您推荐如何达到期望的结果?谢谢!

Could you please recommend how to reach the desired result? Thanks!

推荐答案

您应检查此链接.我正在使用match命令解决方案:

You should check this link. I'm using the match command solution :

:highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+$/

此页面还提供了基于list的解决方案,我没有亲自尝试过

This page also provides list based solutions which I haven't personally tried.

这篇关于在vim中显示尾随空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆