Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

Thanks.

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
add comment

1 Answer

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

VS.

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.