Vim 80列布局关注 [英] Vim 80 column layout concerns
问题描述
我觉得我在Vim中做80列指示的方式不正确: set columns = 80
。有时我也设置textwidth
,但我喜欢能够看到和预期行溢出与设置列
替代。
I feel like the way I do 80-column indication in Vim is incorrect: set columns=80
. At times I also set textwidth
but I like to be able to see and anticipate line overflow with the set columns
alternative.
这有一些不幸的副作用 - 我不能 set number
不同的行号;即, 100行文件和> = 100行文件将需要两个不同的设置列
值,因为用于额外数字显示的额外列。我也开始新的(g)Vim会话,而不是垂直拆分窗口,这迫使我使用窗口管理器的剪贴板 - vsplit
强迫我做
This has some unfortunate side effects -- 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. I also start new (g)Vim sessions instead of splitting windows vertically, which forces me to use the window manager's clipboard -- vsplit
s force me to do set columns
every time I open or close a pane, so starting a new session is less hassle.
如何处理80个新的会话,我们每次打开或关闭窗格时都会设置列 c>,
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屋!