Vimperator for Opera
Friday, July 4, 2008 2:43:59 AM
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 # Friday, July 4, 2008 5:03:01 AM
Tamil # Friday, July 4, 2008 5:11:32 AM
Change to
Blazeix # Sunday, July 6, 2008 2:10:36 AM
Tamil # Sunday, July 6, 2008 5:39:43 AM
Originally posted by Blazeix:
mksdcom # Monday, July 7, 2008 11:12:40 AM
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 # Monday, July 7, 2008 4:46:54 PM
edvakf # Sunday, July 27, 2008 5:56:29 PM
http://my.opera.com/edvakf/blog/2008/07/27/improvement-to-hit-a-hint-bookmarklet-for-opera
kurt duyckiland # Thursday, October 2, 2008 9:59:42 PM
edvakf # Friday, October 3, 2008 6:09:59 AM
This part of the code;
if(key=='Bkspc'){ if(choices.length){ if(choice!=''){ choice=''; }else{ hintlist[choices.pop()].style.backgroundColor=bgcolor;document.title=originalTitle+' - '+choices.join(','); } } }should be something like this (*I haven't tested this*)
if(key=='Bkspc'){ if(choice!=''){ choice=''; }else{ if(choices.length){ hintlist[choices.pop()].style.backgroundColor=bgcolor; } } document.title=originalTitle+' - '+choices.join(','); }Mağruf ÇolakoğluZAHEK # Saturday, November 29, 2008 9:13:56 AM
dabbish # Monday, December 1, 2008 4:27:58 PM
poisson # Tuesday, December 9, 2008 10:18:59 AM
Just a question: I would like "f" to open links in the current page, and not in a new one. Is this possible?
Blazeix # Wednesday, December 10, 2008 8:04:07 PM
poisson # Friday, December 12, 2008 11:19:38 PM
blubrasi # Sunday, January 25, 2009 12:43:16 AM
blubrasi # Sunday, January 25, 2009 4:14:04 AM
dabbish # Sunday, January 25, 2009 1:11:52 PM
awesome plug-in though
you can do space for down, and gg for home
kurt duyckiland # Thursday, January 29, 2009 1:52:50 PM
" 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 # Thursday, February 5, 2009 2:12:21 PM
Blazeix # Sunday, March 1, 2009 4:37:25 AM
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 # Thursday, March 12, 2009 12:47:53 AM
NickPadeenC # Monday, March 30, 2009 11:30:09 AM
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 # Tuesday, March 31, 2009 12:52:49 PM
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 # Thursday, April 16, 2009 9:06:30 AM
I was wondering if it might be possible to implement hit-a-hint giving access to search fields as well (in addition to links).
blubrasi # Saturday, May 2, 2009 1:54:44 PM
jabu2oz # Monday, May 11, 2009 11:15:20 PM
"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 # Friday, August 7, 2009 2:21:45 PM
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 # Wednesday, November 25, 2009 10:13:41 AM
If you do this, your set of shortcuts will be much better.
Carson Firecarsonfire # Thursday, March 4, 2010 4:38:34 PM
srunni # Saturday, March 13, 2010 11:37:34 PM
Ramón Solísramonusky # Sunday, April 18, 2010 6:59:15 AM
409 [Bookmarks Panel]
410 d=close window
¿?
If anyone has the complete file, please... i've been looking for days and still nothing =(
kurt duyckiland # Wednesday, May 5, 2010 1:50:10 PM
kurt duyckiland # Thursday, May 6, 2010 10:51:59 PM
kindest regards
Michaelpurgat0ri # Friday, July 9, 2010 10:36:53 AM
kurt duyckiland # Friday, July 9, 2010 9:12:02 PM
Michaelpurgat0ri # Saturday, July 10, 2010 7:15:26 PM
Kurtosis # Wednesday, August 18, 2010 6:27:06 AM
http://github.com/byrongibson/vimperopera
Hopefully work will continue on it. Firefox, Chrom/ium all have Vim addons, Opera needs a good one too, and Vimperopera is the best one available (there's also Vopera at GitHub, but it's not going anywhere. Read the README on its GitHub page for a wtf).
Blaze if you ever read this and want to take over hosting Vimperator on GitHub, I will be more than glad to turn it back over to you, just PM me at GitHub.
Michaelpurgat0ri # Thursday, August 19, 2010 1:26:33 PM
Michaelpurgat0ri # Sunday, November 7, 2010 5:01:06 AM
Michaelpurgat0ri # Wednesday, November 24, 2010 12:02:04 AM
wang-dawei # Thursday, November 25, 2010 6:35:20 AM
Vijay Kaulgogobera # Tuesday, December 7, 2010 3:10:05 PM
bkolada # Saturday, December 11, 2010 6:25:38 PM
Johnny Englishdumblob # Saturday, December 18, 2010 11:33:33 AM
See this post http://my.opera.com/community/forums/findpost.pl?id=8005242
I'm so happy - but the awaiting beats me
Michaelpurgat0ri # Wednesday, January 19, 2011 9:21:35 PM
Шуйский Николай [krigstask, Ŝtérkrìg]Sterkrig # Friday, April 15, 2011 10:45:43 AM
Шуйский Николай [krigstask, Ŝtérkrìg]Sterkrig # Saturday, April 16, 2011 12:22:10 PM
plumm # Sunday, June 26, 2011 3:02:55 AM
Шуйский Николай [krigstask, Ŝtérkrìg]Sterkrig # Monday, June 27, 2011 8:41:12 AM
Actually you just have to configure your terminal, being it xterm, urxvt or anything. And `x-terminal-emulator` is Debian/Ubuntu-specific.