Vimperator for Opera
Friday, 4. July 2008, 02:43:59
One of the best extensions out there for Firefox (in my opinion, at least) is Vimperator. Quoting from the Vimperator index page, "Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor." I and many of my friends have installed Vimperator, and immediately became addicted to it. It sped up workflow and was fun at the same time. Vimperator is the main reason why I stuck with Firefox so long before switching to Opera.
A while ago I decided to test out Opera, figuring that I'd eventually switch back to Vimperator. Before I switched back, however, I took a look at the versatile keybindings and customization available. I was so impressed I decided to stick with Opera, and recreate the Vimperator functionality. I've emulated some of the features I use the most in vimperator, including common keybindings and the Hit-a-Hint navigation. I've uploaded my configuration to this post, so you can enjoy Vimperator navigation with the speed of Opera.
InstallationTo make Opera 9.51 behave like Vim, and by extension Vimperator, follow these instructions:
- Download the attached file 'vimperopera.ini' (see bottom of post) and place it in your profile under the 'keyboard' directory. Under Linux, this directory is under:
~/.opera/keyboard
For Windows, look underC:\Documents and Settings\user\Application Data\Opera\Opera\profile\keyboard
- Open up your preferences window and navigate to Advanced->Shortcuts->Keyboard Setup and choose 'vimperopera'. Press O.K.
- (Optional) To get a more authentic Vim[perator] experience, you may want to hide all of your toolbars except for the tab bar and address bar. Do this from the Tools->Appearance->Toolbars tab, and press Shift+m to toggle the menu bar on/off. I put my address bar at the bottom of the window, and kept the tab bar at the top. I hid all the other toolbars.
Now, vim and vimperator are modal programs and Opera, well, not so much. However, I feel very comfortable using the vimperopera keybindings and can switch back and forth between vimperator and vimperopera with ease. Almost all of your trusty vimperator keybindings are available (At least, the ones that I could find mentioned in the Vimperator documentation, which seems to be lacking). All the shortcuts I've grown attached to such as gh (go to homepage), gH (go to homepage in new tab), o, O, t, T, etc. are all working. See the list below for the keybindings.
As I mentioned earlier, hit-a-hint spacial navigation, which I can't live without, has been emulated using Javascript bound to the 'f' key for basic hints and ';' for extended hints.
- Basic hints ('f') - Displays numbers next to each link. Type the number of link and press enter to go to that link. If the number you type has only one possible hint, that hint will be automatically chosen for you.
- Extended hint mode (';') - Displays numbers next to each link, and allows you to open multiple links at a time. Type in the numbers of the links you want to follow, separated by a comma, and press enter when you are done. Those links will open in new tabs.
Screenshot of Vimperopera in hints mode
- I found that the Opera Standard Slim Skin, by Tamil, fits well with the whole Vim look. It's a minimalistic skin that decreases the padding of the default Opera skin.
- I use google bookmarks, so I bound ':' to 'focus address bar', nicknamed the google bookmarks page 'bmarks', and the 'Add to bookmarks' bookmarklet 'bmark'. Now, when I type ':bmarks' and ':bmark' I get a list of bookmarks and a prompt to 'Add page to bookmarks,' respectively.
- I also dislike how google automatically steals focus for its search bar, so I added the 'blurgoogle' UserJS, see attached.
Here are a list of the hotkeys available with this keybinding. This list omits the default keybindings for brevity.
| Key Combo | Description |
|---|---|
| shift m | Toggle Menubar |
| h | move left |
| j | move down |
| k | move up |
| l | move right |
| H | Back |
| Ctrl o | Back |
| L | Forward |
| Ctrl i | Forward |
| gh | go to homepage |
| gH | go to homepage in new tab |
| gt | next tab |
| gT | previous tab |
| d | delete (close) tab |
| o | address bar |
| O | address bar with current url |
| t | new tab |
| T | new tab with current url |
| gu | go up one level |
| u | undo close tab |
| y | yank (copy) current address on to clipboard |
| p | paste clipboard contents |
| P | paste clipboard contents into new tab |
| i | focus first form field |
| gi | focus previous form field |
| [[ | Rewind |
| ]] | Fast forward |
| r | refresh page |
| / | find |
| n | find next |
| N | find previous |
| Ctrl Insert | Copy |
| Shift Insert | Paste |
| zi | zoom in |
| zo | zoom out |
| wq | hide opera |
| ZZ | quit opera |
| e | open xterm |
| Ctrl q, dw | delete a word in a text field |
| Ctrl q, dd | clear a text field |
| Ctrl q, d$ | delete to end of line |
| b | bookmark |
| ctrl b | bookmark list |
| m | |
| : | focus address bar |
| f | hints mode |
| ; | extended hints mode |








Moose # 4. July 2008, 05:03
Tamil # 4. July 2008, 05:11
Change to
Blazeix # 6. July 2008, 02:10
Tamil # 6. July 2008, 05:39
Originally posted by Blazeix:
mksdcom # 7. July 2008, 11:12
Hit-a-hint spacial navigation is a NICE CODE!
So,I add some code,"e.preventDefault();" in interpretKeyStroke function.
The code passed Opera's default key event.
Please visit my page,and reading my code.
http://looxu.blogspot.com/2008/07/blog-post_07.html
Thanks!
Blazeix # 7. July 2008, 16:46
edvakf # 27. July 2008, 17:56
http://my.opera.com/edvakf/blog/2008/07/27/improvement-to-hit-a-hint-bookmarklet-for-opera
kurt duyck # 2. October 2008, 21:59
edvakf # 3. October 2008, 06:09
This part of the code;
should be something like this (*I haven't tested this*)
z@h3k # 29. November 2008, 09:13
dabbish # 1. December 2008, 16:27
poisson # 9. December 2008, 10:18
Just a question: I would like "f" to open links in the current page, and not in a new one. Is this possible?
Blazeix # 10. December 2008, 20:04
poisson # 12. December 2008, 23:19
josef behr # 5. January 2009, 10:01
Rasmus Steinke # 25. January 2009, 00:43
Rasmus Steinke # 25. January 2009, 04:14
dabbish # 25. January 2009, 13:11
awesome plug-in though
you can do space for down, and gg for home
kurt duyck # 29. January 2009, 13:52
" just replace the window.open(XXXX) calls with location.href=XXXX, where XXXX is whatever is in the parentheses" did not work for me. however it also works with window.open(getURLchoice(),'_self');
dabbish # 5. February 2009, 14:12
Blazeix # 1. March 2009, 04:37
As the change log states, I also made it so 'normal hints mode' opens the link in the current window by default. This works on my computer. iland had trouble with manually putting in the change, but hopefully that was user error and this update will work for everybody.
dabbish # 12. March 2009, 00:47
Nick # 30. March 2009, 11:30
Here is my request (we all get one request, don't we? :) )
If you work in technology or research you often want to restrict your google searches to fairly recent information. I have my own search set up that is the google one, but with the addition of restricting the date of the page to the last year using the google advanced search's URL.
However, often you want to switch between the date-restricted search and the normal search, when you realise you want older info, or more recent info, etc. Something I find really useful is the ability to change the google search URL to change some date restrictions. So I have F5 set to: 'go to page,"%u&as_qdr=y"', which changes the existing search to less than 1 year filter, plus adds the google date restriction drop-down box (Google adds this automatically when you use a date filter). You can use the drop-down box to alter your date filter.
BTW, I'm guessing the '&as_qdr=y' parameter decodes as '&AdvancedSearch_QueryDateRestriction=Year'.
You can change the URL parameter string from the default of &as_qdr=y to &as_qdr=Xy, where X is a number of years, and you can change the time frame from 'y' to 'm' or 'd', although google may in fact return results that conform more closely to their inbuilt date ranges. It's still very useful though. Also, changing the parameter away from Google's defaults removes the drop-down box. Page-back returns it.
Ok, enough of the explanation. What I'd like is some way to change the shortcut so that it opens in the same tab rather than opens the new one that 'go to page' does.
More advanced, it would be really useful for some javascript tied to another key that pops up a message box where you can enter something like one of 'y', '3y', 'm', '3m', '7d', 'd' and so on, which is then appended as the date restriction. This would be much more useful than the current functionality of defaulting to one year, and then you have to change it manually yourself.
Phew, after that spiel, I need my own blog page. Thanks again,
Nick.
shkm # 31. March 2009, 12:52
I believe this truly shows off the power of Opera--it may not have true addons like Firefox, but you can do so much without them.
Many thanks for your work!
tabanhachi # 16. April 2009, 09:06
I was wondering if it might be possible to implement hit-a-hint giving access to search fields as well (in addition to links).
Rasmus Steinke # 2. May 2009, 13:54
jabu2oz # 11. May 2009, 23:15
"Shift+Enter" - open link in background tab function?
I had a go with:
with no avail. Perhaps an Opera specific function will do it?
Also, are there any issues with javascript on secure pages?
edit: edvakf's Hit-a-hint generator seems to do the job.
Vigil # 7. August 2009, 14:21
Also F4, 'a ctrl', 'Enter ctrl', 'Platform Unix-Mac, q ctrl', etc. It appears that vimperopera not only adds shortcuts but takes some useful ones away, too...
Alorian # 25. November 2009, 10:13
If you do this, your set of shortcuts will be much better.