Slackware This Forum is for the discussion of Slackware Linux.
|
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
11-20-2013, 02:24 PM
|
#1
|
Member
Registered: Jun 2012
Distribution: Slackware
Posts: 79
Rep: 
|
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.
|
|
|
11-20-2013, 04:41 PM
|
#2
|
Member
Registered: May 2007
Distribution: Slackware
Posts: 288
Rep: 
|
: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.
|
|
|
11-20-2013, 06:24 PM
|
#3
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
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.
|
|
|
11-21-2013, 06:38 AM
|
#4
|
Member
Registered: May 2004
Distribution: BSD
Posts: 269
Rep: 
|
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
|
|
|
11-21-2013, 08:49 AM
|
#5
|
Member
Registered: Jun 2012
Distribution: Slackware
Posts: 79
Original Poster
Rep: 
|
Quote:
Originally Posted by lems
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 
|
|
|
11-23-2013, 04:40 PM
|
#6
|
Member
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 442
Rep:  
|
Quote:
Originally Posted by TobiSGD
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.
|
|
|
All times are GMT -5. The time now is 04:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|