Changing background color in vim at a certain column

后端 未结 3 722
不思量自难忘°
不思量自难忘° 2020-12-25 13:58

I\'d like to be able to highlight the wrap margin/text width in vim by changing the background color (or maybe just a line?). A lot of IDEs have this. I mocked up what I\'

3条回答
  •  轮回少年
    2020-12-25 14:00

    Try this:

    :match ErrorMsg '\%>80v.\+'
    

    It will highlight text beyond 80 characters, you can replace '80' with whatever wrap-width you have. However, it will only highlight the characters that exceed the width, and then only on lines that are actually longer than the width.

    Check http://vim.wikia.com/wiki/Highlight_long_lines for more info, but they all pretty much accomplish the same thing.

提交回复
热议问题