简体   繁体   English

gVim 在编辑 txt 文件时如何避免自动创建行

[英]gVim how to avoid automatic line creation when editing txt file

In my _gvimrc file I have set :在我的 _gvimrc 文件中,我设置了:

set wrap设置换行

set textwidth=0 wrapmargin=0设置 textwidth=0 wrapmargin=0

The problem is that when I edit a *.txt file, gVim keeps to create a new line when I reach the 80 column.问题是当我编辑一个 *.txt 文件时,gVim 在我到达 80 列时继续创建一个新行。

To avoid this I went in menu Edit -> File Settings -> Text Width and I set "0" instead of the "78" that was written.为了避免这种情况,我进入菜单 Edit -> File Settings -> Text Width 并设置“0”而不是写入的“78”。 In this way the problem disappears but only for the current session.这样问题就消失了,但仅限于当前会话。 When I close and reopen gVim, Edit -> File Settings -> Text Width -> "78" again, my "0" settings has disappears.当我关闭并重新打开 gVim 时,编辑 -> 文件设置 -> 文本宽度 -> 再次“78”,我的“0”设置消失了。

How can I avoid this automatic line creation, or how can I set permanently Text Width 0 in gVim?如何避免这种自动线条创建,或者如何在 gVim 中永久设置文本宽度 0?

在 _gvimrc 文件中添加:set formatoptions-=t

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM