VIM insert mode doesn't work properly with Ubuntu 14.04.1 VM via SSH.
For example left arrow key causes current line to be pushed down, and a character D inserted instead.
Shortcut like ci" doesn't work as well.
Anyone having this problem too?
Most likely a VMFusion problem since I don't have this problem with my VPN.
Using iTerm2 and VMFusion 6.0.4.
resting wrote:
2) The command I use is vi, but it's really just vim in ubuntu.
You might also try this (from solution 9):
sudo apt-get install vim
Perhaps this will help: http://apple.stackexchange.com/questions/3369/why-dont-my-arrow-keys-work-in-vim-under-iterm
Thanks for the link. I tried, but it still doesn't work.
Problem might be due to VM cause I don't have problems with using VIM in iTerm2 on my local machine, or VPN via SSH.
Its only when I SSH to the VM that causes VIM to break.
Perhaps this will help: http://vim.wikia.com/wiki/Fix_arrow_keys_that_display_A_B_C_D_on_remote_shell
I see this problem in all sorts of situations (including ones that don't involve a VM). I am not enough of an expert on terminal types to understand exactly what's going on, but I usually work around it by installing the "vim-nox" package. Somehow the "fuller" vim packages are more capable of dealing with whatever is being sent. Like I said, I don't pretend to understand why, and it feels like a lame solution, but it usually Works For Me (TM) and is easy enough to do.
Cheers,
--
Darius
Some points from the last link to check:
1) Does your account in the VM have a ~/.vimrc?
2) Are you invoking vim as vim rather than vi?
1) Nope there's no ~/.vimrc
2) The command I use is vi, but it's really just vim in ubuntu.
I might be slow to respond or test out all the solutions here, as I think I can still live by using command mode to navigate around.
resting wrote:
1) Nope there's no ~/.vimrc
2) The command I use is vi, but it's really just vim in ubuntu.
In that case, see solution 5 in the most recent link I posted. I think that you will find that this behavior is intentional.
resting wrote:
2) The command I use is vi, but it's really just vim in ubuntu.
You might also try this (from solution 9):
sudo apt-get install vim
I have replicated your problem with a fresh Ubuntu installation, and I have confirmed that the following fixes it:
sudo apt-get install vim
I believe I have now found the optimal solution.
Edit /etc/vim/vimrc.tiny in the Ubuntu VM. Change the line that says:
set compatible
to
set nocompatible
That did the trick for me.
Thanks again so much for helping.
This really solved the trouble of the work around I'd been doing.
So it really turns out that I had to do a apt-get install vim to fix all those weird behaviors.
Changing /etc/vim/vimrc.tiny to set nocompatible helped fix the arrow keys but didn't fix the backspace keys and some commands like ci" or caw.
But apt-get instal vim seems to fix everything I used.
this worked for me on my new ubuntu installation in vmware.