Linux vi arrow keys broken in insert mode

2019-01-08 04:41发布

My arrow keys don't work in vi in insert mode at home, they just each insert a newline and a capital letter, like 'A'. Is there a way to fix that?

标签: linux vim vi
11条回答
贪生不怕死
2楼-- · 2019-01-08 05:32

vi does not support arrow keys in insert mode. Use vim. Although your vi may just be a link to vim, it may be configured to behave like the "original" vi and thus disables the arrow keys. Just invoke vim directly.

查看更多
干净又极端
3楼-- · 2019-01-08 05:32

I just had an issue with arrow keys after switching over to use git in .vim.

I have installed this repo - https://github.com/sunaku/.vim

and after digging around for an hour, I found that AutoClose plugin (which didn't like anyway) broke the arrow keys.

The plugin docs suggest that one should set set ttimeoutlen=100, but that didn't work for me! (using urxvt+screen or urxvt, and even xterm)

So I removed the plugin at the end.

查看更多
放我归山
4楼-- · 2019-01-08 05:33

I had the same issue while using vim inside Windows 8.1 with Cygwin.

Solution worked for me is, just run the following command in your Cygwin terminal:

cp vimrc_example.vim ~/.vimrc
查看更多
放我归山
5楼-- · 2019-01-08 05:36

You might also want to try 'noesckeys'

查看更多
仙女界的扛把子
6楼-- · 2019-01-08 05:38

In the command line write this:

EXINIT="set nocompatible"; export EXINIT
查看更多
登录 后发表回答