bindctl
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | bindctl [2016/08/23 03:44] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ======Synopsis: | ||
| + | $__bindctl__(FUNCTION < | ||
| + | $__bindctl__(SEQUENCE < | ||
| + | $__bindctl__(MAP [< | ||
| + | |||
| + | The bindctl function is a low level interface to the keybinding system. | ||
| + | A // | ||
| + | A // | ||
| + | A //MAP// is a collection of SEQUENCES that begin with a common sub-sequence. | ||
| + | The client comes with a variety of built-in // | ||
| + | |||
| + | =====How to work with your own FUNCTION===== | ||
| + | In each case, the first argument is the name of your function (" | ||
| + | argument is what you want to do with that keybinding. | ||
| + | and 0 or the empty string for failure, unless they say otherwise. | ||
| + | |||
| + | Create a new keybinding that will run the // | ||
| + | |||
| + | $bindctl(FUNCTION name CREATE statement) | ||
| + | |||
| + | Destroy a keybinding you created with $bindctl(). | ||
| + | |||
| + | $bindctl(FUNCTION name DESTROY) | ||
| + | |||
| + | Test whether a keybinding exists -- returns 1 for yes, 0 for no. | ||
| + | |||
| + | $bindctl(FUNCTION name EXISTS) | ||
| + | |||
| + | Return the keybinding' | ||
| + | you originally provided. | ||
| + | |||
| + | $bindctl(FUNCTION name GET) | ||
| + | |||
| + | Return the names of all keybindings whose names begin with //string// (ie, command-completion) | ||
| + | |||
| + | $bindctl(FUNCTION string MATCH) | ||
| + | |||
| + | Return the names of all keybindings that match the //pattern// (which can contain wildcards) | ||
| + | |||
| + | $bindctl(FUNCTION pattern PMATCH) | ||
| + | |||
| + | Return the package associated with the keybinding | ||
| + | |||
| + | $bindctl(FUNCTION name GETPACKAGE) | ||
| + | |||
| + | Set the package associated with the keybinding | ||
| + | |||
| + | $bindctl(FUNCTION name SETPACKAGE) | ||
| + | |||
| + | |||
| + | =====How to work with SEQUENCES===== | ||
| + | Bind the sequence " | ||
| + | |||
| + | $bindctl(SEQUENCE chars SET function args) | ||
| + | |||
| + | Return the // | ||
| + | |||
| + | $bindctl(SEQUENCE chars GET) | ||
| + | |||
| + | Set the package associated with the sequence //chars//. | ||
| + | |||
| + | $bindctl(SEQUENCE chars SETPACKAGE) | ||
| + | |||
| + | Get the package associated with the sequence //chars//. | ||
| + | |||
| + | $bindctl(SEQUENCE chars GETPACKAGE) | ||
| + | |||
| + | |||
| + | =====How to work with MAPs==== | ||
| + | Delete all keybindings that begin with // | ||
| + | |||
| + | $bindctl(MAP chars CLEAR) | ||
| + | |||
| + | ======Real Example: | ||
| + | Create a keybinding named " | ||
| + | $bindctl(FUNCTION GREETINGS {echo Hi there!}) | ||
| + | |||
| + | Bind Escape-g so it runs your new keybinding | ||
| + | $bindctl(SEQUENCE ^[g GREETINGS) | ||
| + | |||
| + | Stop all this silliness | ||
| + | $bindctl(SEQUENCE ^[g NOTHING) | ||
bindctl.txt · Last modified: 2016/08/23 03:44 by 127.0.0.1
