Vimperator tips and tricks

Joaquin L. Pereyra
Avalanche of Sheep
Published in
3 min readDec 31, 2014

Vimperator can be an extremely useful addon for Firefox, specially if you are already a vim user or if you are striving to be one. But it can be a little bit of a mess for newbies. Here I try to compile some of the tips I have found online over the time I’ve been using Vimperator.

Vimperator can also be beautiful

Vimperator can be a little ugly by default, at least in my opinion. But did you know you can theme it? My personal favorite is a molokai-based theme that you can find on this github page.

It looks something like this:

vimperator molokai

Installing vimperator themes is not big deal: just download the .vimp file to ~/.vimperator/colors and then, when on vimperator, do:

:colorscheme (name of the file)

Vimperator will anyway give you a list of the available themes so it shouldn’t be too hard. Remember to add this to your .vimperatorrc file if you are happy with the results! Or you can just do:

:mkvimperatorrc

to build your .vimperatorrc for you.

There are several vimperator themes available. A quick google should give you some more options. Or you can check out this repository with some nice variants.

Also, this theme left link hints a little bit too small for my taste. You can fix this with:

:highlight Hint -append font-size:150%;

Of course you can modify the percentage.

Readability integration with Vimperator

I use Readability a lot to make webpages more readable. Luckily, there’s an easy way to replace Readability buttons or booklet with vimperator, because, if you are like me, you want those hidden to maximize the amount of display space on your monitor.

:command! -nargs=0 -description="Read now with readability" readnow open javascript:(%0A%28function%28%29%7Bwindow.baseUrl%3D%27//www.readability.com%27%3Bwindow.readabilityToken%3D%27%27%3Bvar%20s%3Ddocument.createElement%28%27script%27%29%3Bs.setAttribute%28%27type%27%2C%27text/javascript%27%29%3Bs.setAttribute%28%27charset%27%2C%27UTF-8%27%29%3Bs.setAttribute%28%27src%27%2CbaseUrl%2B%27/bookmarklet/read.js%27%29%3Bdocument.documentElement.appendChild%28s%29%3B%7D%29%28%29)

You can replace ‘readnow’ with whatever command you’d like and of course you can also edit the description.

I found this trick online some time age, but I don’t remember where.

Follow links with letters instead of numbers

Default way of following links with numbers is a bit clunky for me, as I have to move my fingers away from their resting position a lot. I much better like to just use letters. This is easily achievable with just one command:

:set hintchars=hjklasdfgyuiopqwertnmzxcvb

Ctrl-a selects everything

By default, Vimperator maps to some other action, so you’ll have to press ignore before every time you want to actually select everthing in a text field. You can automatize this with:

:inoremap <C-a> <Insert><C-a><Insert>

1-line scroll is boring

No one like to scroll one line at the time. And generelly one want to scroll faster upwards than downward. So…

noremap j 5j
noremap k 10k

Any more?

Those are basically mine. I have a few other custom settings but they are just customization options for myself and depend much upon each individual decisions. Do you have any other vimperator trick you want to share? Please do.

--

--