tags:

views:

240

answers:

4

Smething just happened in the last 20 minutes or so to my vim. I must have hit something, but I can't figure it out, and nothing will get it back to the 'real' behaviour.

I've always used : to jump to a line number. Now, when I hit : then a number - (1-9), vim instead goes in to "insert" mode and inserts a letter. (1=q, 2=r, 3=s, 4=t, 5=w, etc.)

Trying to search around for this is worse than looking for a needle in a haystack!

Any ideas as to what sort of secret "mode" I've enabled? And better yet, how I might get back to normality?

Thanks!

+1  A: 

Not sure what you've done there but you can also jump to a specific line number by entering the line number and then hitting G (shift-g).

Shift-g on its own will take you to the last line of the file.

HTH

cheers,

Rob

Rob Wells
Recommenting here: It's even more basic than what I'd described. Hitting any number key will automatically enter insert mode. It's nothing to do with the colon key.So, I can't enter "125G" to jump to that line because the "1" auto-enters insert mode (and enters 'q').Thanks for suggestion tho.
mgkimsal
A: 

Closing and opening vim should reset whatever you funky mode you've discovered. If not, you've got something profoundly weird going on -- vim doesn't store settings that are turned on while in the file.

BTW, you're totally ruining my "vim doesn't break" meme.

Robert Fischer
Sorry, but's it's 100% hosed up. Closing vim did nada. VIM breaks, and when it does, you're profoundly hosed. :(
mgkimsal
+1  A: 

It could be your shell and not VIM. If restarting VIM doesn't fix your problem, try opening a new shell and using VIM there. If nothing works, move your .vimrc file and any shell start ups out of the way (by renaming, not deleting, of course), open a new shell, and VIM. If that doesn't work, try a new keyboard. :-(

tvanfosson
And maybe .viminfo?
Rob Wells
A: 

Well, I've no idea what it was, but rebooting the computer - Macbook running leopard - seemed to work.

I'd tried new shells to no effect. I just didn't want to have to reboot.

See - macs have problems too! :(

Thanks for all the quick responses from all y'all. Hopefully I won't have to figure that one out again.

mgkimsal