On my new machine I installed cygwin, the great set of unix tools for win32, (BTW this is what makes using a win32 machine acceptable IMHO, it just works like a unix box...) and as usual in vi (or vim) my arrow keys pop me out of insert mode and then insert a newline and 'A' 'B' 'C' or 'D' - very annoying.
So the search started.... and I remembered the simple solution from the last time. People say in this situation that it is your terminal, and not vim that is misconfigured. I'm not sure I believe that, because the fix includes vim.
All you need to do is modify your .vimrc file. Copy the example .vimrc file from /usr/share/vim/vim62/vimrc_example.vim to ~/.vimrc then open vi and its fixed :)
Great, thats what we like - annoying problems, simple solutions
52 comments:
Goodness, so much has this problem plagued me, but I didn't realize it was so easy to fix. I stumbled onto this page via Google when trying to find a solution again, as a matter o' fact. I'll certainly remember this from now on. Thanks for the tip!
Glad to be of assistance ;)
Pleasure to be of assistance :)
Great. I find this page *after* I found out about the solution myself.
Thank you soooo much! Saved me much frustration.
Wow, fan-tastic! Could not thank you enough, this has been driving me crazy for quite a while!
No problem ;)
I was having this exact same problem with rxvt under msys/MinGW. It boils down to vim defaulting to Vi compatible mode. This is due to there being no .vimrc file. Making one with something like this should fix the problem.
set columns=80
set wrapmargin=8
set ruler
I should add also that setting backspace=2 will solve the funny backspace problems.
So maybe even "touch ~/.vimrc" will do the trick?
I'm not sure, anytime I have to install cygwin I just copy the whole file. There are a lot of good settings in there (syntax highlighting etc)
Still feeling the love in 2009. Thanks for the tip.
Thanks! You saved me too! Even more than 4 years on from your original post!
Thanks worked great!
On a more recent version of cygwin vim62 is now vim72
Thank you very much!
Wonderful. Wish I'd seen this around, oh, when you posted it. Thank you thank you thank you
Thank you soooooooooooooooo much.....for last 3 hours i was googling and trying to fix this problem n finally this blog came for my rescue
Hi Simon,
I have been using linux since last 1 year but when i configured my new pc then this problem came...thanks a lot dear for ur support
Hi Simon,
I have been using linux since last 1 year but when i configured my new pc then this problem came...thanks a lot dear for ur support
that was easy!! Thanks a lot
For what it's worth, this mainly boils down to having a "set nocompatible" line toward the top of the file. The "set backspace=indent,eol,start" probably helps out, too. You can temporarily get the same non-vi-compatibility without a .vimrc (e.g. if you're at a coworker's machine) by running vim with the "-N" flag or by typing ":set nocompatible" in command mode.
thanks for the tip Brian, hope I remember it !
There was no default file for me to copy, so I used the suggestion of creating a new file with the followign lines:
set columns=80
set wrapmargin=8
set ruler
backspace=2
Worked like a charm, now can you fix my running powershell from cygwin issue?
Thanks for the handy solution. Great help.
Thank you for your post, I have used vim under cygwin for long time. And today it really annoys me, and found your post. It fixed my long time problem. Thank very much!
Thanks a lot!
You are most welcome :)
Funny as, 7 years after this being written, it is still very usefull ;-)
Thank you very much for your post ;-)
Thank's a lot
Thanks a lot!!!! (Its 2012!!)
thanks a lot simon
You're welcome!
This is an awesome post. Such a simple solution! Thanks mate ;-)
no problem!
thanxx a lottt.............!!!!
you're welcome!
Had this problem just now.. Solved, thanks!!
You're welcome!
wow, 7 years down the road and it's still an effective solution. Thanks Simon!!
Seven years down the road and it's still an effective solution. Thank Simon!!
thanks for solution
Just to MeToo what Anthony Bouttell said. 7 years later and awesome post is still awesome. Many thanks.
Thanks a kajillion! That was a ridiculously easy fix to a real painful problem!
Can you create a video for it because me and my friends are not getting how to get this!!!!
Can you create a video for it because me and my friends are not getting how to get this!!!!
Many thanks! It solved the nagging arrow issue on my machine :)
Thankyou so much for this fix! This has been frustrating me to no end - having vim running normally is like a breath of fresh air. Thankyou!!
If you find that vim does not parse the .vimrc file, rename it to .virc and try again.
mv ~/.vimrc ~/.virc
Worked for me.
Or link the two so any changes are read regardless of what .vi* file gets parsed.
ln ~/.vimrc ~/.virc
Thank you!
BR,
Govind
Thanks a lot. . . It was of gr8 help.
Thanks a lot boss..
Post a Comment