Show 'space' character via listchars only for leading spaces

那年仲夏 提交于 2019-12-05 04:42:37

I don't think that linechars will help you, but this highlight might help:

highlight WhiteSpaceBol guibg=lightgreen
match WhiteSpaceBol /^ \+/

Change the color scheme for whatever you like best.

If you insist on having the fancy · you can get them with a bit of a hack:

set listchars=space:·
highlight WhiteSpaceBol guifg=blue
highlight WhiteSpaceMol guifg=white
match WhiteSpaceMol / /
2match WhiteSpaceBol /^ \+/

Now, only the starting · are visible! (change the white for whatever color you use as background and blue with the color of your choice).

NOTE: If you use the console Vim, replace (or add) guibg with ctermbg and the proper colors.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!