Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wanting to change the key from f to something else for Vimperator's key function. I'm guessing I use a similar code to this one:

:map <whateverkeyiwant> <hint>

But the thing is, <hint> doesn't work for the hint function as I've already tried it. So what would I place in those brackets to get this to work? And if I'm completely wrong about this, what different code should I use?


share|improve this question
I don't know if it would make any difference, but did you try this on pentadactyl? It's the "successor" of vimperator, as it is a fork of the project, where most of the developpers went to, so if there's a bug in :map, it might have been corrected there. – Dalker Dec 27 '11 at 8:15
Actually I did try pentadactyl but it seemed pretty buggy and much slower than Vimperator. So I switched back. – monkish Dec 28 '11 at 14:23
Anyways, I got this to work. I just mapped a new key that uses the 'f' key. – monkish Dec 28 '11 at 14:25

Vimperator, like Vim, refers to functions by the keys they are bound to by default. Thus, you don't map keys to functions like hint, but to other keys that serve as names for those functions:

:nnoremap j f    ;maps j to what f does, so maps j to show hints

To explain, nmap defines a mapping in normal mode, which tells vimperator to perform f's function when you type j EXCEPT when you are inserting text. You want this mapping to occur in normal mode only, because otherwise you'll try to type jumping jellybeans and get fumping fellybeans.

nnoremap does the same thing, except it ensures that anything you map to j later on gets mapped to j's old function (move page down) instead of j's new function (show hints). Here's the difference:

nmap j f
nmap k j   ;k now activates hints, because that's what j currently does


nnoremap j f
nnoremap k j   ;k now moves the page down, because that's what j NORMALLY does

I strongly suggest tht you use nnoremap until you have a compelling reason not to since it can save you a lot of trouble trying to figure out why nothing's working the way you think it should.

If you want to save these maps to use forever instead of just having them for one session, type :mkvimperatorrc. This will put all of your Vimperatormappings and other settings active in the current session into a file called _vimperatorrc in your home directory. That file then becomes a list of commands that Vimperator executes on startup to change your settings to how you want them. :)

share|improve this answer
Should be the accepted answer! Good stuff, thank you. – AlexAffe Mar 13 '15 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .