在Vim中,你可以用'set cursorline'停止空格字符的颜色变化吗? [英] In Vim can you stop the color change of white space characters with 'set cursorline' on?
问题描述
在这个Vim截图中,您可以看到,当将光标移动到一条线上时,它会将空白字符(左侧所示)的正常颜色从灰色更改为黑色。无论光标位置如何,我可以停止此操作并将它们始终显示为灰色吗?
In this Vim screenshot you can see that when moving the cursor over a line it changes the normal color of the whitespace characters (shown on the left) from grey to black. Can I stop this and leave them showing grey always, regardless of cursor position?
我尝试在配色方案中设置这些,但没有运气:
I've tried setting these in the colour scheme but no luck:
hi SpecialKey guibg=bg guifg=#CCCCCC gui=none
hi NonText guibg=bg guifg=#CCCCCC gui=none
推荐答案
您可以使用:match
突出显示标签。
You can use :match
to highlight the tabs.
:match NonText '^\s\+'
这似乎覆盖了光标线。最好是使用 matchadd()
,但它似乎被光标线覆盖。可能有办法使它工作
That seems to override the cursor line. It would be better of course to use matchadd()
but it seems to be overriden by the cursor line. There might be a way to make it work
这篇关于在Vim中,你可以用'set cursorline'停止空格字符的颜色变化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!