开发者

How to correctly highlight cursor line in VIM?

开发者 https://www.devze.com 2022-12-28 05:25 出处:网络
VIM can be configured to highlight current line via :hi cursorline guibg=green and set cursorline commands. But if I enable tabs display via:

VIM can be configured to highlight current line via :hi cursorline guibg=green and set cursorline commands. But if I enable tabs display via:

:hi specialkey guifg=grey guibg=grey
:set listchars="tab"
:set list

Cursor line highlight will corrupt tabs dis开发者_如何学Pythonplay:

alt text http://dl.dropbox.com/u/239055/vim_cursorline_bug.png

Any hints how i can avoid corruption so may tabs are highlighted with one color and cursor line is highlighted with another color without any ^I displayed at intersection?


Try setting listchars without the quotes:

:set listchars=tab:>-

This shows the tab as >------- instead of ^I, which I think is what you were asking. When the cursor is on the line with the tab, the whole line is displayed in the cursorline colour.

It appears that the cursorline colour takes precedence over the specialkey colour, which is consistent with your screenshot.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号