Vim在引号内添加并对齐新行

3
当我在引号内输入内容,并且该行达到了Vim窗口的宽度时,Vim会自动添加一个新行。
例如:
export_data(...['official stmt url, issue',])

在引号内写入内容时,变成了:

export_data(...['official stmt url, issue
                 , new line aligned',])

我希望禁用这个功能。我猜测这是由我的vimrc文件中的某些设置引起的,但我不知道是哪一个。

2个回答

3
最简单的解决方法是禁用textwidth:
:se textwidth=0 wrapmargin=0

要找到原因,需要执行以下操作:

:verbose set tw wm fo

这将显示类似于以下内容:

  textwidth=78
    Last set from /usr/share/vim/vim73/ftplugin/help.vim
  wrapmargin=0
  formatoptions=tcroql
    Last set from /usr/share/vim/vim73/ftplugin/help.vim

1

看起来你的textwidth值比较窄。要禁用它,请将其设置为零。

set textwidth=0

请查看:help textwidth以获取完整信息。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接