Gvim 中的自动换行

发布于 2024-07-16 15:45:32 字数 28 浏览 6 评论 0原文

如何使 Gvim 自动换行而不在中间断词?

How do I make Gvim word wrap in such a way that doesn't break words in the middle?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

趁年轻赶紧闹 2024-07-23 15:45:32

看来网上还是有解决办法的。

:set formatoptions=l
:set lbr

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

Looks like there is a solution online after all.

:set formatoptions=l
:set lbr

Link: http://vim.wikia.com/wiki/Word_wrap_without_line_breaks

李不 2024-07-23 15:45:32

您可以

:set nowrap 

让大行在屏幕边缘滚动。 但 tw 可能是更好的选择。

You can

:set nowrap 

to just let huge lines scroll of the edge of your screen. But tw is probably the better way to go.

神也荒唐 2024-07-23 15:45:32
:set tw=78

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

:set tw=78

sets the text width to 78 characters. You can use "[movement]gq" to re-wrap some text.

海螺姑娘 2024-07-23 15:45:32

你可以

:set wrap linebreak nolist

you can

:set wrap linebreak nolist
潦草背影 2024-07-23 15:45:32

我使用以下设置来换行诸如 Markdown 文件之类的长行。

: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

I use the following settings to wrap long lines for things like markdown files.

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

Source: http://vim.wikia.com/wiki/Word_wrap_without_line_breaks

仄言 2024-07-23 15:45:32

您还可以使用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.

You can also use wrapmargin, which the manual defines as:

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文