LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 10-08-2014, 06:15 PM   #1
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Rep: Reputation: 25
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?
 
Old 10-08-2014, 06:56 PM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
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.
 
1 members found this post helpful.
Old 10-08-2014, 07:01 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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?
 
Old 10-09-2014, 02:48 AM   #4
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Original Poster
Rep: Reputation: 25
Mapping the keys seems to work, thanks. And no, I have not changed the keyboard layout.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Ubuntu 12.04 computer's arrow keys, page-up and page-down keys suddenly freeze julianvb Linux - Software 7 06-20-2014 06:33 AM
[SOLVED] Control characters in Shell mode (left, right, up and down arrow keys) jags1984 Linux - Newbie 19 04-03-2013 11:19 PM
Arrow keys not working flamingvan Solaris / OpenSolaris 5 10-03-2006 05:47 AM
Shift-arrow and Alt-arrow keys don't work in xterm Aviv Hurvitz Linux - General 2 09-30-2006 03:43 PM
VIM and the arrow keys Buto Linux - Software 1 09-16-2004 07:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration