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.Installation
To 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/keyboardFor Windows, look under
C:\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.
- 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 modeAdditional Approvements
- 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.
|shift m||Toggle Menubar|
|gh||go to homepage|
|gH||go to homepage in new tab|
|d||delete (close) tab|
|O||address bar with current url|
|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|
|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|
|ctrl b||bookmark list|
|:||focus address bar|
|;||extended hints mode|