47

如何让 Gvim 自动换行,不会在中间打断单词?

4

6 回答 6

57

毕竟网上好像有解决办法。

:set formatoptions=l
:set lbr

链接:http: //vim.wikia.com/wiki/Word_wrap_without_line_breaks

于 2009-04-13T15:16:15.630 回答
19

你可以

:set nowrap 

只是让大线条滚动屏幕边缘。但是 tw 可能是更好的方法。

于 2009-04-13T15:06:39.460 回答
7

你可以

:set wrap linebreak nolist
于 2014-12-23T21:21:26.320 回答
6
:set tw=78

将文本宽度设置为 78 个字符。您可以使用“[movement]gq”重新换行一些文本。

于 2009-04-13T15:01:44.103 回答
1

我使用以下设置来包装诸如降价文件之类的长行。

:set wrap
:set linebreak
:set nolist  " list disables linebreak
:set textwidth=0
:set wrapmargin=0

来源:http: //vim.wikia.com/wiki/Word_wrap_without_line_breaks

于 2016-02-03T15:12:11.190 回答
-1

您还可以使用 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.
于 2009-04-13T15:14:00.423 回答