-
Notifications
You must be signed in to change notification settings - Fork 55
Home
For Vim users, there is Vimperator. For Emacs users, there is KeySnail.
![Check icon](http://github.com/mooz/keysnail/raw/master/wiki/icons/check.png)
This extension provides very flexible way of customizing the keybindings.
You can define or choose the arbitrary function written in JavaScript, and bind it to the arbitrary key sequence through the initialization file.
Yes, this extension allows you to bind functions to the key sequence not just the shortcut key.
![Check icon](http://github.com/mooz/keysnail/raw/master/wiki/icons/check.png)
For Emacs junkies, KeySnail provides a lot of commands and functions which emulates the Emacs behavior.
Part of features are listed below.
- Customization through the init file named .keysnail.js which correspond to .emacs file.
- Keyboard macro.
- Prefix argument system.
- Prompt system. (In elisp, this interface is called completing-read)
- Selector system. (If you are the Emacs user, you may know anything.el and this interface provides it to the Firefox!)
- Minibuffer system. Just press M-x and you can call a lot of functions.
![Check icon](http://github.com/mooz/keysnail/raw/master/wiki/icons/check.png)
KeySnail has the plugin system which allows user to extends KeySnail with lot of features.
If you are the Firefox extension developer or familiar with the userChrome.js, it’s easy to start writing the KeySnail plugins.
KeySnail loads the .keysnail.js / _keysnail.js from user home directory (or a profile directory in Windows) and execute it. This directory can be changed in the preference dialog.
Init file is the complete JavaScript program. You can call JavaScript / Firefox API and moreover, other extensions function.
You can bind the function to the key sequence, using the functions listed below.
key.setGlobalKey(keys, func, ksDescription, ksNoRepeat); key.setEditKey(keys, func, ksDescription, ksNoRepeat); key.setViewKey(keys, func, ksDescription, ksNoRepeat); key.setCaretKey(keys, func, ksDescription, ksNoRepeat);
Here are the descriptions of the each argument.
Specify key (string) or key sequence (array). if you want to bind a function to mutliple key sequence use ‘array of array’. The expression of the key follows the Emacs like below example.
Ctrl + Alt + t | C-M-t |
Arrow Key | <up>, <down>, <left>, <right> |
PgUp, PgDn | <prior>, <next> |
F1, F2, F3 | <f1>, <f2>, <f3> |
Specify anonymous function. This function can take two arguments.
- argument 1 => key event
- argument 2 => prefix argument (or null)
You can use these arguments through declaring the following expression.
function (aEvent, aArg)
Specify description of the function. You can omit this argument.
When this value is false, command (function) is executed prefix arguments times.
If you want to use prefix argument in your function and do not want to repeat it, set this value to true.
you can omit this argument.