lsu*_*und 5 vim formatting word-wrap
我正在寻找一种在 vim 中编写和编辑较长段落的技术。本质上,我想要的是 vim 表现得像我目前正在写这个问题的 html textarea。
在某种程度上,如果我set wrap和映射到并映射到set linebreak,我就会得到这种行为。然而,在视觉模式下,移动仍然是线状的,我知道没有方便的方法来选择长线的一部分。jgjkgk
此外,我知道textwidth如果光标的当前列高于某个阈值,该选项会自动换行。但是,如果我从中间编辑该行,当它变得太长时,该行不会自动断开。
我也知道我可以gq用来格式化一组选定的行,但一段时间后它会变得很烦人。
在 vim 中自动换行的技术是什么?
如果您a在 formatoptions 中设置,您可能会得到您想要的:
:set formatoptions+=a
Run Code Online (Sandbox Code Playgroud)
见:http : //vimdoc.sourceforge.net/htmldoc/change.html#auto-format
...
a Automatic formatting of paragraphs. Every time text is inserted or
deleted the paragraph will be reformatted. See |auto-format|.
When the 'c' flag is present this only happens for recognized
comments.
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
217 次 |
| 最近记录: |