Arrow keys are incorrectly mapped in vim

Bug #62980 reported by Trey Ethridge
74
This bug affects 4 people
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: vim

I'm testing the Edgy release. I have a Dell Latitude D600 laptop. I'm using the US keyboard layout. When I start vi and enter edit mode the arrow keys on the right don't navigate. Instead, they print capital letters onto the screen. The arrow keys navigate properly in the Dapper release.

Changed in vim:
status: Unconfirmed → Confirmed
Revision history for this message
Philip Guyton (phil-lxnet) wrote :

I get similarly unusable key mappings as this using a very generic desktop, uk keyboard, and the edgy rc with all updates as of writing applied.

I get exactly the same as the duplicate bug 67105 whilst in a gnome-terminal and very different but equally unusable key mappings whilst in a regular terminal (Ctrl-Alt-Function-key).

Work Around:-
But all is well in both gnome-terminal and a regular terminal if I invoke vim.tiny not via "vi" but using "vim".

p.s. my alternatives settings
/etc/alternatives/vi -> /usr/bin/vim.tiny
/etc/alternatives/vim -> /usr/bin/vim.tiny

Hope this helps

Revision history for this message
IbeeX (ibrkanac) wrote :

Same thing was here when using vi as sudo arrow keys where wrongly mapped
if used vim it was OK, also after installing vim.full it is all working OK

Revision history for this message
Andy Ross (andy-plausible) wrote :

I can confirm this too: when /usr/bin/vim.tiny is run normally (with an argv[0] of ".../vim.tiny") the arrow keys work as expected, and as they did on Dapper. When the same binary is run as "vi" instead, it gets the arrow keys wrong. This looks like a vim (or vim configuration) bug.

Revision history for this message
Constantine Evans (cevans) wrote :

Thank you for your report, but this is actually the intended behaviour of the vi command. When invoking vim-tiny, the variant of vim installed by default, using the vi command, it reads /etc/vim/vimrc.tiny, which sets the compatible mode, so that vi acts like the original vi. The broken arrow keys are part of that compatibility. In reality, the bug is that in Dapper, the arrow keys aren't incorrectly mapped when running vi.

To run vim, instead of vi, use the vim command, which reads /etc/vim/vimrc.

Changed in vim:
status: Confirmed → Rejected
Revision history for this message
IbeeX (ibrkanac) wrote :

This is really funny explanation, I am sure that majority off users expect that vi command actually point's to vim, as it was case with prior ubuntu versions. Probably there should be option via dpkg-reconfigure to use vi compatibility

Revision history for this message
Constantine Evans (cevans) wrote :

The intended behaviour is to have vi use set compatible, as noted in the vim manpage, /etc/vim/vimrc.tiny, and a variety of other places. The behaviour in Dapper was a bug. In fact, I've even filed a bug report about this (bug 70569).

Revision history for this message
IbeeX (ibrkanac) wrote :

any why
there will be always more people who expect vi to behave like vim then other way that is obviously joust look at this bug how many duplicates it have already. :)
And if user expect that arrow keys behave like vi then this is mostly power user who now how to fix this :)

Changed in vim:
status: Rejected → Needs Info
Revision history for this message
Trey Ethridge (tethridge) wrote :

I totally agree that the default behavior should be for it to be mapped like vim. Ubuntu's slogan of having things "Just work" should apply here. The majority of users will consider this to be broken until the mappings are restored to the way it was previously configured in dapper.

Revision history for this message
Nicolò Chieffo (yelo3) wrote : Re: [Bug 62980] Re: Arrow keys are incorrectly mapped in vim

Why, in compatibility mode the arrows, are not interpreted?

Revision history for this message
Constantine Evans (cevans) wrote :

Nicolò, the arrow keys aren't mapped because compatibility mode acts exactly like the original vi, down to bugs if I recall correctly.

For this bug, I can understand the desire to have vi start vim. However, if someone wants to start vim, they need to run vim. One wouldn't use the command emacs and expect xemacs to start by default, would they?

IbeeX, a power user will not know how to fix this, because it is not easy to fix. It breaks the -v option to vim as well as breaking the vi command. The only way to fix it right now means setting compatible in vimrc, which then prevents them from running vim in nocompatible mode without changing the vimrc.

Finally, this isn't a bug - all documentation for vim states that vi and vim -v start vim in compatibility mode and read vimrc.tiny. What you are requesting is a change in the behaviour of vim, which, according to https://wiki.ubuntu.com/Bugs/CommonTasks, should go to the appropriate mailing list instead of being discussed on launchpad. But do note that I have discussed this ubuntu-devel before, and was told by several people that vi should start vim in compatibility mode (I wanted vi to start vim at the time). Perhaps with more people, you will have more success.

Changed in vim:
status: Needs Info → Rejected
Revision history for this message
Reuben Firmin (reubenf) wrote :

I also agree that "vi" should work as it did. I've been using ubuntu since hoary, and to my recollection the arrow keys have always worked as I have expected (and, I've used a large number of distributions since '99, and don't remember any of them shipping by default w/out intuitive arrow key mappings). If power users need vi to work "properly", then they can make a .virc (or whatever). For regular users, vi should work as intuitively would be expected regarding arrow keys in edit mode. Please revert.

Revision history for this message
Liegerm (dcaldwell) wrote :

This behaviour does seem a bit odd. It has kept me guessing for about a day. What's one of the first things I want to do after installing Ubuntu? Edit some text files...

If you want to keep the distro space down, maybe vi can be set by default as an alias of some sort to vim?

Revision history for this message
Constantine Evans (cevans) wrote :

The 'vim' command is already there by default (vim-tiny is installed). If you want vim, use the 'vim' command. Vi isn't vim.

In response to Reuben, there is nothing to revert. The 'vi' command has always been this way.

In response to Liegerm, isn't the 'vim' command already there after installing? I know that it isn't the full version, but it is still there and should act like vim rather than vi.

Personally, I think the whole thing is rather silly, but the response I received on -devel seemed to indicate that there was considerable support for keeping 'vi' as meaning compatible mode.

Revision history for this message
Constantine Evans (cevans) wrote :

Sorry for the spam, but I should point all of you to bug 70569 as well, which pertains to the issue, and explains why there is some confusion over what vi does.

Revision history for this message
joe (lastguy) wrote :

this cheap bug still in 8.10

Revision history for this message
onebir (bironelynch) wrote :

Well there's some dispute over whether it's actually a bug. But for someone unfamiliar with vi/vim & how one or the other's 'supposed' to work - perhaps using it to edit some config files because they can't boot into the GUI - the current situation could render this tool unusable. For them, it looks like a bug & quacks like a bug...

For people who do know how vi/vim are supposed to work will, it looks & quacks like compatibility mode.

So why not just "fix" it for the people who'll perceive it as a bug & ship a la fix here:
http://ubuntuforums.org/showthread.php?t=449784

The only downside is *not* confusing the experts...

Revision history for this message
Raphael Krut-Landau (raphael.krut-landau) wrote :

I'm experiencing a variation on this bug, and the unfortunate downside is that I'm prevented from using one of my favorite Vim features. I can use the arrow keys in insert mode just fine, but when I type forward slash "/" to search the file, and hit the up arrow key (to browse my search history), Vim switcheroos to insert mode and prints "ABCD" at the cursor in the pattern others have identified. Tarnation!

Is there a quick fix? If not, I'll happily file a bug report in more detail.

- Raffi.

Revision history for this message
Wendell Nichols (wcn00) wrote :

I don't observer Raffi's behavior with vim. Of course the vi we now get by default doesn't work as it used to. My solution:
edit .bashrc and
alias vi=vim

cest la vie...
wcn

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.