&dactyl.appName; can repeat commands in a number of ways, from repeating the last command, to recording and playing macros, to saving its state and executing scripts.
Repeat the last keyboard mapping
Repeat the last Ex command
Record a key sequence as a macro. Available macros are
0-9a-zA-Z. If the macro is an uppercase letter, the
recorded keys are appended to the lowercase macro of the same
name. Typing
List recorded macros matching the optional regular expression
Delete recorded macros matching the regular expression pat. If ! is given, all macros are deleted.
Plays the contents of macro with name a-z0-9
Replay the last executed macro
Read Ex commands, JavaScript, or CSS from file. Files are
interpreted based on their extensions. Files which end in
.js are executed as JavaScript, while those ending in
.css are loaded as Cascading Stylesheets, and anything
else is interpreted as Ex commands. In normal cases, any errors
generated by the execution or non-existence of file are
printed to the
Environment variables in file are expanded to their current
value, and the prefix ~ is replaced with the value of
$HOME. See
When a CSS file is sourced, its contents are applied to every web page and every chrome document, including all browser windows and dialogs. If the same file is sourced more than once, its previous rules are cleared before it is applied again. Rules can be restricted to specific documents by enclosing them in @-moz-document blocks.
JavaScript files are executed with full chrome privileges in their own global namespaces. These namespaces are stored as objects in the plugins object, in the property named after the full path of the sourced file. This means that any variables or functions created by your script are stored as properties of that object. Additionally, all properties of the global window and modules objects are accessible to your script as global variables.
Files in ~/.&dactyl.name;/plugins may additionally be
accessed in plugins.filename where filename
is the last component of the file's path stripped of any
extensions, with all hyphens stripped and any letter following a
hyphen capitalized. So, the file
~/.&dactyl.name;/plugins/foo-bar.js may be accessed as
plugins.fooBar. See also
Ex command files are executed as if each line were entered into the &tag.command-line; individually. Additionally, certain commands support the same ‘here document’ syntax supported by most Unix shells and by the &tag.command-line;. So, to execute a JavaScript statement which does not comfortably fit on a single line, you can use
See also
:js <<EOF
var hello = function () {
alert(Hello world );
}
EOF
Immediately load all plugins which have yet to be loaded. Because
plugins are not automatically loaded until after
Source the specified file from the first directory in
List all sourced script names, in the order they were first sourced.
Stop sourcing a script file. This can only be called from within a &dactyl.appName; script file.
Ex command scripts are similar to both entering commands on the &tag.command-line; and to Vim scripts, but with some notable differences.
Commands in Ex command scripts can span multiple lines by prefixing the second and further lines with a \ character. For instance, the following all define commands whose definitions span multiple lines.
:command! foo
\ -description A command that frobs bars
\ :javascript frob(content.bar)
:style -name foo
\ foobar.com
\ p:first-line { font-variant: small-caps ; }
\ div#side-bar > :first-child { display: none ; }
:command! do-some-stuff
\ -description A command which does some stuff in JavaScript
\ :javascript <<EOF
\ window.do(some );
\ window.do(stuff );
\EOF
:command! do-some-stuff
\ -description A command which does some stuff in JavaScript
\ :javascript
\\ window.do(some );
\\ window.do(stuff );
Lines may be commented out by prefixing them with a " character.
" This is a comment
foo bar " This is a comment
This is not a comment
foo bar This is not a comment
Profile a piece of JavaScript code or an Ex command. Run
code
When