Skip navigation.

exploreopera

| Help

Sign up | Help

emacs keyboard bindings

, ,

For quite some time I have been using my own Emacs Keyboard Bindings in Opera. Time to share (v 0.1).

The basic idea is to have frequently used bindings quickly accessible by one-key bindings in both the browser and the mailer, and reserve simple prefixes for subgroups of actions, more complex prefixes for more rarely used bindings. Models have been Emacs itself, some text browsers (and emacs-w3m) and some mail readers (and Gnus). Not all the functionality could be mapped one-to-one, and not everything I have chosen to map directly.

I follow the Emacs convention for key combinations and sequences, but use Ctrl and Alt instead of C and M. Keys that are to pressed simultaneously are connected with a dash (-), and keys following each other are to be pressed in sequence.

Browsing
For the basic browsing functionality the following bindings are available:

g                prompt for a URL
c                copy URL of document
u                copy URL of selected link
e                edit URL of document
E                edit URL of selected link
h                go to homepage

n                go forward
b                go back
r                reload

a                add URL of document to bookmarks
s                subscribe to feed


Editing
In editing context I use Emacs bindings (including Ctrl-w for cutting, and not for closing the active tab, as the binding in the default configuration does):

Ctrl-w           cut
Alt-w            copy
Ctrl-k           cut to end of line
Ctrl-y           paste
Shift-ins        paste PRIMARY (mouse selection)
Ctrl-u           clear
Ctrl-_           undo


Mail
The main bindings in mail view are simple and straight-forward:

Shift-g          retrieve new mail
n                next mail
p                previous mail
k                mark mail as read
m                compose new mail
r                reply to mail
Ctrl-c Ctrl-c    send message


And last but not least,
Ctrl-x Ctrl-s    save
Ctrl-x Ctrl-c    quit Opera


A more complete list of bindings is also available with Ctrl-h b.

Note:
Due to Opera's handling of bindings, it might be that you need to fix some of the shortcuts: they are commented in the INI file. The commented out version is what the binding is supposed to be, and you might need to adapt this to your keyboard layout. One example: Ctrl-_ is the binding for undo, but on a US keyboard layout you'll need the following in your INI file:
- ctrl shift=Undo


Enjoy - and feedback welcome!


Update:
Some updates in mail bindings, and other small fixes.

Update 2:
Some more minor fixes, and you can now also get it from the opera keyboard setups section in the community.

Update 3:
A few more minor fixes and some more bindings (thanks petteri). 2007-05-22

downwardsmulti-window

Comments

avatar
I have been talking about doing this for a year now, but never done anything about it. Cheers for this kick in the butt, it's a good template to build upon.

- ØØ -

By NoteMe, # 3. May 2007, 13:35:34

avatar
Please keep me in the loop :smile: I'd be curious to see what you come up with. There are still quite a lot of things I haven't cleared with myself: all the ones I am still in doubt about are removed from that version, but I am using them myself.

By csant, # 3. May 2007, 13:46:04

avatar
I have similar key bindings worked out. In addition to your mine has also:

main window (these are nice since the you can nicely move on page):
ctrl p = srcoll up
ctrl n = scroll down
ctrl b = scroll left
ctrl f = scroll right
alt < = go to start
alt < shift = go to end

ctrl v = same as pagedown key
alt v = same as pageup key (conflicts with some menu)

edit widget:
alt-d = delete word (this one I'm using a lot, strange that you don't have it)

I would suggest that some kind of cycle tabs with ctrl-x-b would also be neat.

Add these bindings and the emacskey file will truly rock :smile:

By petteri, # 22. May 2007, 20:36:24

avatar
About that, I have wanted to write an update on this for a while now, but the Alt key brought me to a halt. Since the Alt key is used for the File menu. Alt-d (although shouldn't it delete a single character?) is ok, but what about all those that is used up by the file menu. I wanted to make the Edit Widget work as close to Emacs as possible, but that seems to be impossible since the File menu takes control even though the edit widget is active. Something that is understandable for most people, but there really should be a way to override this default behaviour for more advanced users. Does anyone have any input on this? Any pretty solutions (even ugly solutions are welcome)?


- ØØ -

By NoteMe, # 22. May 2007, 20:54:30

avatar
petteri, thanks for your suggestions! I have updated the file (plus a few minor fixes I had), but before uploading a new version to the my.opera section, I want to figure out a few more things - for now you can get the latest version from my server.

Some remarks:
  • I had bound Alt-< and Alt-Shift-> to back and forward history for a tab, but for standard emacs bindings your suggestion makes more sense;
  • Some bindings on Alt- clash with menus - a possible solution is to edit the menu you use to start each top level menu item with digits;
  • Note that some bindings are also available as single-key bindings: to close the page you can either just q or Ctrl-q, or t either opens a new tab (page), or opens the currently focussed link in a new tab (page) - or Ctrl-t just opens a new tab (page) in any case...


I am also still struggeling with various Ctrl-x prefixed stuff...

By csant, # 22. May 2007, 21:41:21

avatar

Originally posted by csant:

Some bindings on Alt- clash with menus - a possible solution is to edit the menu you use to start each top level menu item with digits;


Now that makes perfect sense (at least in my world). Then again, I have never done any changes to Opera like that before. A quick test shoed me that changing the language file gave result (ie. -1486159215="&1 File"), but should it be possible by changing the menu.ini files too? I can't see I have stumbeled over anything of interes in any of those.

Well, it is night time++ in Oslo now. And work tomorrow, so need to have an other look at this an other day.



- ØØ -

By NoteMe, # 22. May 2007, 22:57:40

avatar
I'm liking it so far. M2 editing needs to get more like editing in Emacs to not annoy me to death. Never use the Alt-bindings in menus, so getting rid of all of them would be no problem.

By Valgrind, # 23. May 2007, 08:25:04

avatar
Valgrind, any specific things you are thinking of? When you say "M2 editing", do you mean the mail compose window, or the mail view? If the latter, would you have any suggestions on which mailer in emacs you think should be the reference to use the bindings of?

I have been thinking of making different setups for emulation of various mailers, but have not made up my mind yet.

By csant, # 23. May 2007, 10:27:39

avatar
Thanks for updating the bindigs. I downloaded the .ini-file in it seems really nice. It's shame that find next can't also be in ctrl-s (in emacs you can use incremental find, like find next, only using ctrl-s). I modified keys so that find next is in alt-s, it's almost like ctrl-s P:

I have one minor problem, the undo combination. It seems to work in the addresbar but not in the text widget (like in this comment form).

Also one thing that is missing is marking a region, which is the same thing as selecting something. The default behavior for this in Opera is hold shift and then move around with arrow keys to paint the selection. I would guess that it is not possible to change this to behave like it does in emacs (ctrl-space and then move around and select things then again ctrl-space to end selecting).

By petteri, # 23. May 2007, 15:03:38

avatar
Hmmm, just noticed tha undo binding seems to work if I use the minus sign on the numpad.

By petteri, # 23. May 2007, 15:11:58

avatar
petteri, you are addressing two of my biggest issues :smile: Unfortunately, marking a region the emacs way and also the repeated incremental search on the same binding are currently not possible due to the way Opera's input is designed. I have been trying to find either a workaround, or a nice replacement - I like Alt-s :smile: - and Alt-r finds previous :wink:

I'll look into the undo issue tomorrow.

File updated. Thanks for input! :smile:

By csant, # 23. May 2007, 17:57:50

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.

July 2008
SMTWTFS
June 2008August 2008
12345
6789101112
13141516171819
20212223242526
2728293031