Opera is exceptionally customisable, and stores most of its setting in initialisation (INI) files. These files are usually stored in three main locations (see new official documentation here):
INI-files are simply text files and quite easy to read and change. For a list of all internal commands (actions) with their syntax, see AllActions. In some commands you can use IniFileVariables, consisting of a percentage sign ("%") and a letter. (See VimIntegration for how get completion of actions in vim)
Since Opera V7.1x - it is better to make copies of the default INI files and modify these copies. You only need to put differences in these files[1], as Opera checks differences in the customised files, then uses the defaults for everything else. So copy and paste from the default files to your customised versions those sections you want to change.
INI files are generally composed of sections delimited by [ and ], followed by configurations lines. For example there are two sections ([Version] and [Info]) in the following INI extract:
; Menu specification file for Opera 7.0 [Version] File Version=2 [Info] Name=My menu prefs Description=Personal Opera menu setup Author=John Doe johndoe@example.org Version= Comments=This file contains only modified items...
The FILE VERSION string in the [Version] block must be at least 2, if the file is to be read by Opera.
In the [Info] block you can put in info about your file:
The NAME string defines what name the setup will have in Opera's preferences.
The DESCRIPTION string is not yet displayed, but can be used to put in a description of the file.
The AUTHOR string is not displayed yet either, but can hold info about the author. You can put an e-mail or web address here so people can reach you with questions.
The VERSION string is an internal file version. You can either use internal versioning, or put in the version of Opera these setups are intended for.
The COMMENTS string is an unofficial string first used by DarkElf, you can use this to specify a comment about the file which is only read by people editing the file.
Here is a list of the different INI files and their locations (more found here):
For those files which are overwritten on upgrades or reinstalls, you can get your old copies back from the \Uninst\Backup subdirectory in the program directory.
We will use an example tip from the OperaTips page - adding 'Open in FireFox' and 'Open in IE' to the right-click menu (but you can generalise the tecniques to other types of editing). From V7.1x, it is better to edit the files in the profile directory, not the defaults directory. So find your profile directory (see above), then go to the menu subdirectory. By default there is NO file here, so you have two options:
Opera Preferences version 2.0 ; Menu specification file for Opera 7.0 ; This file is stored in UTF-8 encoding [Version] File Version=2 [Info] Name=My menu prefs Description=Personal Opera menu setup Comments=This file contains only modified items... Author= Version=1
This needs to be present at the top of each custom INI file. One created, then, for each menu section you want to customise, copy the whole section from the defaults/standard_menu.ini and paste in your new menu file; for the tip example we are dealing with, we want to modify [Document Popup Menu] section, so we copy that over and then make our edits. The full customised my_menu.ini should finally look like this:
Opera Preferences version 2.0 ; Menu specification file for Opera 7.0 ; This file is stored in UTF-8 encoding [Version] File Version=2 [Info] Name=My menu prefs Description=Personal Opera menu setup Comments=This file contains only modified items... Author= Version=1 [Document Popup Menu] Item, 50426, = Back Item, 50427, = Forward Item, 67648, = Rewind Item, 67649, = Fast Forward --------------------1 Item, 50428, = Reload Submenu, 200000, Reload Menu --------------------2 Item, 70464 = Add to bookmarks, 1 Item, 50215 = Copy document address Item, 65178 = Send document address in mail Item, "Open in IE" = Execute program, "iexplore","%u" Item, "Open in Firefox" = Execute program, "firefox","%u" --------------------3 Item, 50004 = Print document Item, 44002 = View document source Item, 70465 = Validate frame source --------------------4 Include, Internal Frame Include, Internal Document Background --------------------5 Item, 50995 = Enter fullscreen | Leave fullscreen
Save this version, then go to Opera Preferences » Advanced » Toolbars and select your new menu file. This second method is much more future proof - Opera only loads the differences you made - so if a new version of Opera has new menu items in other menus, they will automatically appear, whereas with the simpler method, you'll have to re-edit everything each update (and that can be a lot of work...)
Need help determine which ini section handle which menu?
Use the Opera Browser helper menu.
It adds a menu item to each menu that will display a alert box with the menu section name.
Note: If you want to use a JavaScript Bookmarklet as a menu item you have to replace all quotation marks in the source code with single quotes.
OK, here is our next foray into customising Opera (assuming you have never done this before). This time, we will use the example of how to change the way Opera closes page tabs, so that after closing one, the tab to the right becomes active (like in FireFox). This uses the wonderful GUI built into preferences, so we don't even have to touch an INI file (Opera does the editing for you!) Opera contains an extensive list of internal commands that control every aspect of it's function. So, to close a page, there is the nice intuitive command "Close page", and to make the next tab along active, we use the command "Switch to next page". To add commands together we use the ampersand "&" to connect them.
The mouse gesture normally used to close pages is DOWN-RIGHT, to change it we do the following:
GestureDown, GestureRight Close page & Switch to next page
To change the keyboard binding (Ctrl+W) to close a page in the same way, follow the procedure above but this time for the keyboard setup. The program command will be the same as above, but the key command "Ctrl+W" is actually written as "w ctrl" in the Opera keyboard system. So find "w ctrl" in the list (there is a quick find search box at the top of the dialog to make it easier), and edit the command as above. Nice and simple huh?
If you want to get Opera to do Command-A OR Command-B, then you use the "|" symbol; for example to close the page tab, and if no more page tabs are open then close Opera instead, use this command:
Close page & Switch to next page | Exit
See CustomCommands for some more 'ready-made' commands you can use to customise your mouse and keyboard setup.
Button1 - left click (not subject to change)
Button2 - right click (not subject to change)
Button3 - middle click = mouse wheel click (action on link is not subject to change the described way, it can only be customized in Preferences - Advanced - Shortcuts - Middle click options)
Button4 to Button{x} - additional mouse buttons (like a thumb button for back, mouse wheel left+right for horizontal scrolling; some mouse drivers apply special functions and not the button clicks, but with them sometimes you can apply keyboard-shortcuts and make use of them in Opera with the drawback they may be useless in other applications; not sure what exactly works with Opera)
FlipForward - hold left button and click right button
FlipBack - hold right button and click left button
GestureUp - hold right button and move up
GestureDown - hold right button and move down
GestureRight - hold right button and move right
GestureLeft - hold right button and move left
GestureDown, GestureRight=Close page, 1
= move the mouse down and afterwards right without releasing the right button opens a new page=tab
GestureDown, GestureRight, GestureUp=New browser window
= drawing U while right mouse button is pressed opens a new Opera window)
GestureLeft shift=Rewind
[1] - This is somewhat complicated, because Opera's difference engine only works per section and not per line. So if you want to change a key command in the [Application] section, you have to copy THE WHOLE SECTION ([Application]), even if you only change one line within it...