vim left and right column highlight

久未见 提交于 2019-12-24 15:29:45

问题


I need to highlight anything beyond column 72 with a different background color. What's the best method? Something similar to a visible line margin that some editors do is also good. Is it possible?

Some background:

The syntax is a Pascal like, and works correctly.

Only the Background needs to change. The foreground is already highlighted as it should be. There are cases where a String will be more than 80 characters and will pass the 72 column limit, and should be highlighted as a string.

The coding standards are similar to COBOL and all characters beyond column 72 should by comment lines. These column 72 comments do start with the comment start character, and are highlighted properly.


回答1:


You can

:match DiffAdd '\%>72v.*'

which will highlight the characters you don't want.

(adapted from here).



来源:https://stackoverflow.com/questions/1524380/vim-left-and-right-column-highlight

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