Answers:
'textwidth' 'tw' number (default 0)
local to buffer
{not in Vi}
Maximum width of text that is being inserted. A longer line will be
broken after white space to get this width. A zero value disables
this. 'textwidth' is set to 0 when the 'paste' option is set. When
'textwidth' is zero, 'wrapmargin' may be used. See also
'formatoptions' and |ins-textwidth|.
When 'formatexpr' is set it will be used to break the line.
NOTE: This option is set to 0 when 'compatible' is set.
'wrapmargin' 'wm' number (default 0)
local to buffer
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.
Options that add a margin, such as 'number' and 'foldcolumn', cause
the text width to be further reduced. This is Vi compatible.
When 'textwidth' is non-zero, this option is not used.
See also 'formatoptions' and |ins-textwidth|. {Vi: works differently
and less usefully}
如果您提到自动换行将长行发送到下一行,请尝试
:set textwidth=0
:set wrapmargin=0
gq
手动将段落重新调整为textwidth。@Engineero应该是正确的。
没有其他答案对我有用(IDK为什么)。
:set wrap!
帮了我大忙(在Windows上使用GVim)。
wrap
提供换行的出现,但并不真正打破文本复制到新的生产线。您可能已wrap
启用,因此将:set wrap!
其关闭。您可以检查:set wrap?
哪个将回显当前值(即wrap
或nowrap
)。
textwidth
,wrapmargin
但这实际上迫使vim进行更新和重新呈现,而没有任何换行。
set formatoptions-=t
应该可以。set formatoptions+=t
将重新打开自动包装。
有关您可以做什么的更多信息formatoptions
,请参阅文档。
:set nowrap
仅阻止它包装行显示,而不阻止插入换行符。