[SOLVED] control of vi editor's response to arrow keys
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.