Wim - weird behavior

I recently deleted my .vimrc, and since I added a few things back and added some plugins, I get this strange behavior.

  • I press "i" to put me in insert mode.
  • I print a character (any character)
  • Suddenly I get a break in a new line, where I started typing.

Extremely annoying! :) Any ideas on what this might be?

+4
source share
8 answers

There are many things that could be given as custom Vim. However, I think this may be your "textwidth" setting.

From Vim Help:

'textwidth' can be set to the maximum width for the line. When a line becomes too long when adding characters, a line break is automatically interrupted.

So, check what the "text width" is set for, and either increase it or set it to 0 to disable this feature.

If this does not work, try what everyone else said, just commenting on all your settings, checking it, fixing the problem. Then slowly turn on the settings again. Maybe use a binary search :)

+4
source

Health Check. What happens if you run as vim -C (compatibility mode like normal vi ) or vim -u NONE (do not load initialization files or plugins)?

+6
source

No, but you could start taking things from your .vimrc one at a time and see if the problem went away. Whichever last was deleted, it may have been the culprit (not always because it could be conflicting plugins).

+4
source

You can back up your .vimrc file, delete the original and run vim , and then create a new vimrc:

 :mkvimrc 

Then you can start adding material from your old one and see which parameter is the problem.

Same thing with plugins, move all of your (non-system) plugins from your plugins directory and add one by one and see which one is the problem.

+1
source

comment out the line after the line of your .vimrc until it starts working as expected.

+1
source

You can try using vim script debugging: "vim -D file". Then you can try to add some breakpoints, etc.

Link: Vim Script Debugging

+1
source

This requires setting up files, such as .vimrc, under source control.

0
source

You can place vimfiles + vimrc somewhere so that others can look at it and possibly determine the source of the error.

Saying that there is an error, without any specific data, nothing ever resulted.

Use some site to embed and post vimrc and a list of plugins (usually people use almost the same ... from www.vim.org).

0
source

Source: https://habr.com/ru/post/1286654/


All Articles