tags:

views:

174

answers:

8

I just recently deleted my .vimrc, and since I've added a few things back in and added some plugins I get this weird behaviour.

  1. I click 'i' to place me in insert mode.
  2. I type a character (any character)
  3. Suddenly I get a newline break right where I started typing.

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

+4  A: 

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

DoxaLogos
+5  A: 

Sanity check. What happens if you run as vim -C (compatibility mode, behave like plain vi) or vim -u NONE (don't load any initialization files or plugins)?

John Kugelman
A: 

This calls for setting files like .vimrc to be under source control.

Alan Haggai Alavi
lol - you're preaching to the choir now!
Daniel
A: 

You could back up your .vimrc file, remove the original and start up vim then create new vimrc:

:mkvimrc

Then you can start adding stuff from your old one and see which setting introduces the problem.

Same with plugins, move all your (not system) plugins out of your plugins directory and add one by one and see which one introduces the problem.

stefanB
+1  A: 

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

Nippysaurus
+1  A: 

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

Link: Debugging Vim Scripts

João Marcus
+3  A: 

There are quite a few things it could be given how customisable Vim is. However I think it might be your setting of 'textwidth'.

From Vim Help:

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

So check what 'textwidth' is set to and either increase it, or set it to 0 to disable this feature.

If this doesn't work, then try what everyone else said of just commenting out all your settings, checking this fixes the issue. Then slowly enabling settings again. Maybe use a binary search :)

David Terei
You're awesome David! Thanks for that!
Daniel
A: 

You could post your vimfiles + vimrc somewhere so others can take a look at it, and maybe determine the source of an error.

Saying that there is an error, without giving any concrete data, never resulted in anything.

Use some paste site, and post your vimrc, and a list of plugins (usually people use pretty much the same ones ... from www.vim.org).

ldigas