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. :)
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 – 2011-12-27T08:15:18.357
Actually I did try pentadactyl but it seemed pretty buggy and much slower than Vimperator. So I switched back. – monkish – 2011-12-28T14:23:54.877
Anyways, I got this to work. I just mapped a new key that uses the 'f' key. – monkish – 2011-12-28T14:25:40.223