LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   control of vi editor's response to arrow keys (https://www.linuxquestions.org/questions/linux-software-2/control-of-vi-editors-response-to-arrow-keys-4175521486/)

rdx 10-08-2014 06:15 PM

control of vi editor's response to arrow keys
 
I love vi and I have been using it a very long time. But it seems to have changed in odd ways. One area is the use of arrow keys. I frequently use the arrow keys instead of the hjkl keys to move the cursor around. This works with the GUI version VIM but not on the CLI version, where the arrow key escape sequences puts the editor unto insert mode. In fact vi seems to go automatically into insert mode a lot when I don't want that. I have a work around, I can set up a console window and then SSH to the localhost. Than "fixes" the arrow keys so they move the cursor rather than causing insert mode.

My question is this: Is there a setup or .exrc command which will allow the arrow keys to work?

linosaurusroot 10-08-2014 06:56 PM

Create .exrc and put in it a command "map t h" then edit the t to leftarrow (r control-V leftarrow) then save and quit.
I think this is what I did on SunOS long ago.

astrogeek 10-08-2014 07:01 PM

Hmmm...

I am really sure that Vim has not changed in this regard.

Just a guess, but since your "fix" will be using the console keymap and in an X terminal it will be using an X keymap, it may mean that you are using a different or broken keymap in X.

Have you changed your Xorg to use a different keymap or keyboard layout in some way?

rdx 10-09-2014 02:48 AM

Mapping the keys seems to work, thanks. And no, I have not changed the keyboard layout.


All times are GMT -5. The time now is 12:40 AM.