- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps this will help: http://apple.stackexchange.com/questions/3369/why-dont-my-arrow-keys-work-in-vim-under-iterm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps this will help: http://vim.wikia.com/wiki/Fix_arrow_keys_that_display_A_B_C_D_on_remote_shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have replicated your problem with a fresh Ubuntu installation, and I have confirmed that the following fixes it:
sudo apt-get install vim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this worked for me on my new ubuntu installation in vmware.