Gvim中的自动换行

时间:2009-04-13 14:58:21

标签: vim word-wrap

如何以不破坏中间词语的方式制作Gvim自动换行?

6 个答案:

答案 0 :(得分:53)

毕竟看起来有一个在线解决方案。

:set formatoptions=l
:set lbr

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

答案 1 :(得分:17)

你可以

:set nowrap 

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

答案 2 :(得分:5)

:set tw=78

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

答案 3 :(得分:5)

你可以

:set wrap linebreak nolist

答案 4 :(得分: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

答案 5 :(得分:-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.
相关问题