Are your Vim / Vi arrow keys making A,C, B etc characters instead of moving around in insert (‘i’) mode ?
Try typing this … it fixes it for me:
:set nocompatible
Or, add the line:
set nocompatible
to your ~/.vimrc file.
Are your Vim / Vi arrow keys making A,C, B etc characters instead of moving around in insert (‘i’) mode ?
Try typing this … it fixes it for me:
:set nocompatible
Or, add the line:
set nocompatible
to your ~/.vimrc file.
Thnks that solved my problem.
solved my problem too… perfect post, you know 🙂
Thank you. You saved my day!
Thanks!
That was driving me CRAZY! Much obliged
Thank you! This was really annoying me and it appears to be fixed now!
In my Ubuntu the setting in /etc/vim/vimrc.tiny had a “set compatible” line. I commented it out and everything is OK for all users…
thnz, made my day..
Thx, great.
The default vim installed with Ubuntu is pretty weak. Fix all arrow movement, backspacing, etc problems with:
sudo apt-get install vim
Thank you so much !!
For vi, you need to add the “set nocompatible” line to ~/.exrc
Now I got a decent VIM.
You’re the man !!
Thanks, I knew it was an easy fix but I couldn’t for the life of me remember the command!
Thank you blog author and also thank you Trent; it seems ubuntu and debian share this odd quirk of bundled vim sucking compared to the version available in repo. I just “aptitude install vim” and it installs — even though it was already there — then suddenly this and many other problems vanish into a puff of logic.
wow it given me the new breaths.
Thanks. That save my working day
Thanks a lot. Saved my life…
especially when on a remote machine via ssh…
Thanks you
Thanks for this!!! It was driving me crazy to not be able to use vi for small edits!
Thanks a lot! You’ve helped me a lot :*!
This is the normal behavior of vim when be called by ‘vi’ name.
Instead of changing the normal behavior, change your call instead by using ‘vim’ or add the following to your /etc/bash.bashrc :
alias vi=vim (or vim.tiny)
Wow, I just updated to 12.04 and the vi in it was driving me …….
Thank you so much for this one!
(I just edited /etc/vim/vimrc.tiny to set nocompatible)
Thank you so very, very much!
hey it was really helpful n it solved a big problem. but will u explain to me what was the reason of the unexpected behaviour of arrow keys and what happens when setting no compatible in .vmrc file pls?
Hi Aparna – I think you’ll find the answer in the comments above (by Trent, Jesse and mjdtjm).
Essentially, the default version of ‘vi’ that comes with Ubuntu is ‘vim-tiny’ and the alternatives system links this to the ‘vi’ command. The original legacy Unix ‘vi’ didn’t support the nicer arrow key cursor navigation supported by ‘vim’ (Vi Improved). To ensure backward compatibility, the default version of ‘vi’ installed is set to compatible mode, which means the cursor keys don’t work as we might expect on a modern system.
By setting ‘nocompatible’ in your .vimrc, you are telling vi (which is ‘vim-tiny’ by default) to act like the newer nicer ‘vim’ rather than old school ‘vi’. Since the change is to the config file in your home directory, this will only effect your user login, not the entire system.
An alternative, mentioned by Trent, would be to:
sudo apt-get install vim
This way you get ‘real’ vim, not ‘vim-tiny’.
That was so crisp and exact. 🙂 Helped me as well! Thanks! 🙂
This has been a pain for me for sometime..
Thanks so much for info….
Well atleast there is still ed, the classic unix editor which you are likely to find on all distributions, Oh except idiotic ones like Arch Linux.
But ed is available on arch.
i love you. I find the solution 2 hours, I wanna stop and I see y. thank you so much
Funny to see that that since 2008 until now, this information is still usefull.
Thanks a lot!!
Thanks very much! Changing /.vimrc didn’t work for me, but Brian’s comment of
“For vi, you need to add the “set nocompatible” line to ~/.exrc”
Sorted my problem! I was sshing from Mac OS X to Ubuntu 14.04 on Virtubox.