LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 11-20-2013, 02:24 PM   #1
Haythem
Member
 
Registered: Jun 2012
Distribution: Slackware
Posts: 47

Rep: Reputation: Disabled
remap "hjkl" keys on vi


Hi, I want to map hjkl keys to jkl; on "elvis" because I started using "i3wm" and i3 actually using jkl; as arrows.
when I map the keys in ".exrc" file they are mapped recursively so they all map to ";". I could not find an option to map non-recursively.
changing i3 keys is easier but actually I think that jkl; is more convenient. also don't want to change to "vim" because I like to stick with slack's defaults.
Any ideas how to do this mapping? Thanks.
 
Old 11-20-2013, 04:41 PM   #2
saulgoode
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 205

Rep: Reputation: 63
:nnoremap j h
:nnoremap k j
:nnoremap l k
:nnoremap ; l

EDIT: missed that you wanted to use vi instead vim. FWIW, vim is no less a Slackware default than vi.

Last edited by saulgoode; 11-20-2013 at 04:43 PM.
 
Old 11-20-2013, 06:24 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 14,868
Blog Entries: 2

Rep: Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798Reputation: 3798
That Slackware has some defaults (just out of curiosity, which DE/WM do you use?) does not mean you shouldn't use what Slackware has to offer on other options. Slackware has Vim in the default installation, so it is as default as any other editor in Slackware.
By the way, I also use i3 and I have reconfigured it to use the Vim keys, since it is the only program I use that differs from the Vim keyboard scheme.
 
Old 11-21-2013, 06:38 AM   #4
lems
Member
 
Registered: May 2004
Distribution: Slackware 32 bit
Posts: 107

Rep: Reputation: 33
Does this work:
Code:
set noremap
map j h
map k j
map l k
map ; l
(I personally use nvi, which was based on elvis.)

edit: /usr/bin/vi is a symlink to elvis on Slackware, so yes, it can be seen as the default.

Last edited by lems; 11-22-2013 at 01:02 AM. Reason: Removed colons as that can be put into ~/.exrc or ~/.elvisrc
 
Old 11-21-2013, 08:49 AM   #5
Haythem
Member
 
Registered: Jun 2012
Distribution: Slackware
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lems View Post
Does this work:
Code:
set noremap
map j h
map k j
map l k
map ; l
my bad, I did the same thing but reversed the keys (map h j instead of map j h).
that solved the issue, Thanks Guys
 
Old 11-23-2013, 04:40 PM   #6
Geist
LQ Newbie
 
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 26

Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
By the way, I also use i3 and I have reconfigured it to use the Vim keys, since it is the only program I use that differs from the Vim keyboard scheme.
This.
You can find Vi(m) binds for pretty much everything, changing your WM to use the same schema is a lot faster (and of course in the end more consistent) than changing all and every Vi(m) bind stuff you might come across in the future.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remap the function keys in Byobu javascriptninja Linux - Software 0 01-29-2012 01:50 PM
remap us to uk props666999 Slackware 3 01-21-2005 04:01 AM
Desperately need to remap keys in Gnome basemodel Linux - Software 2 03-30-2004 11:50 AM
Remap windows keys graffitici Linux - Hardware 1 01-09-2004 04:55 PM
How do I remap keys? LooseCanon Linux - Newbie 1 08-27-2003 05:08 PM


All times are GMT -5. The time now is 07:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration