我该如何使 Gvim 自动换行,但不会在单词中间断开?
看起来终究还是有在线解决方案的。
:set formatoptions=l
:set lbr
:set nowrap
只是让巨大的行滚动到屏幕的边缘。但是 tw 可能是更好的选择。
gvim
中非常宽的文件,我会结合使用 :set guioptions+=b
(启用水平滚动条)。 - Hashbrown您可以
:set wrap linebreak nolist
:set tw=78
将文本宽度设置为78个字符。您可以使用“[movement]gq”重新包装一些文本。
我使用以下设置来换行长行,例如markdown文件。
:set wrap
:set linebreak
:set nolist " list disables linebreak
:set textwidth=0
:set wrapmargin=0
你也可以使用wrapmargin,它在手册中的定义为:
Number of characters from the right window border where wrapping
starts. When typing text beyond this limit, an <EOL> will be inserted
and inserting continues on the next line.