Reputation: 191
Hi my vim automatically insert a newline character after 80 character, which is not my intended behavior. However, I cannot find any line width config in my vimrc file.
How to check whether some config is enabled for this? I want to disable this auto-line-break feature.
Thanks to @romainl reminder, here is the output of the command ":verbose set fo tw":
formatoptions=tcq
Last set from ~/.vim/view/~=+Downloads=+c.txt= line 68
textwidth=79
Last set from ~/.vim/plugin/python.vim line 20
Upvotes: 1
Views: 80
Reputation: 196876
So…
t
in :help 'formatoptions'
and :help 'textwidth'
is set to a non-zero value. Individually, those conditions don't lead to automatic line breaks, it is only when they are both true that you get automatic line breaks.t
in formatoptions
is not a problem in and of itself. It is part of of the default value anyway so you can pretty much forget about it.textwidth
is set to 79
in ~/.vim/plugin/python.vim
. Change its value to 0
to disable the feature.But the interaction of those two files is worrying so I think you should take a look at this document.
Upvotes: 1
Reputation: 61
You might need to configure the following options in your .vimrc
wrap
textwidth
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.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.Upvotes: 0