Vim 80 列布局问题 [英] Vim 80 column layout concerns

查看:21
本文介绍了Vim 80 列布局问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Vim 中进行 80 列指示的方式似乎不正确:set columns=80.有时我也set textwidth,但我希望能够使用set columns 替代方案来查看和预测行溢出.

The way I do 80-column indication in Vim seems incorrect:set columns=80. At times I also set textwidth, but I want to be able to see and anticipate line overflow with the set columns alternative.

这有一些不幸的副作用:

  1. 我不能设置编号,因为害怕在具有不同行号顺序的文件之间拆分;即<100 行文件和 >= 100 行文件将需要两个不同的 set columns 值,因为额外的列用于额外的数字显示.
  2. 我还开始新的 (g)Vim 会话,而不是垂直拆分窗口.这是因为 vsplit 强制我在每次打开或关闭窗格时设置列,因此启动新会话不那么麻烦.
  1. I can't set number for fear of splitting between files that have different orders of line numbers; i.e. < 100 line files and >= 100 line files will require two different set columns values because of the extra column used for the additional digit display.
  2. I also start new (g)Vim sessions instead of splitting windows vertically. This is because vsplit forces me to set columns every time I open or close a pane, so starting a new session is less hassle.

当你要设置数字、垂直拆分等时,你如何处理80个字符的指示?

How do you handle the 80-character indication when you want to set numbers, vertically split, etc.?

推荐答案

我在我的 .vimrc 中设置了这个:

I have this set up in my .vimrc:

highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.+/

对于超过 80 列限制的文本,这会以微妙的红色突出显示背景(无论如何,在 GUI 模式下是微妙的 - 在终端模式下则不然).

This highlights the background in a subtle red for text that goes over the 80 column limit (subtle in GUI mode, anyway - in terminal mode it's less so).

这篇关于Vim 80 列布局问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆