X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Flocale%2Fen-US%2Fmap.xml;fp=common%2Flocale%2Fen-US%2Fmap.xml;h=9ff5c88bbd0dff244a4c5de3b983aaad69f55898;hb=9044153cb63835e39b9de8ec4ade237c03e3888a;hp=8921e811dd9f41db269f98b0bb378e2748f45438;hpb=70740024f9c028c1fd63e1a1850ab062ff956054;p=dactyl.git diff --git a/common/locale/en-US/map.xml b/common/locale/en-US/map.xml index 8921e81..9ff5c88 100644 --- a/common/locale/en-US/map.xml +++ b/common/locale/en-US/map.xml @@ -1,7 +1,7 @@ - + -:map :echo Date() +:map :styletoggle -name

- causes “:echo Date()” to be typed out - whenever is pressed, thus echoing the full date - to the command line. + causes “:styletoggle -name ” to be typed out + whenever is pressed, providing a way to toggle + a tab-completed named user style. +

+ +

+ You can also map keys to Ex or + JavaScript commands, see the + examples.

@@ -56,6 +62,7 @@

i
Insert mode: When interacting with text fields on a website
t
Text Edit mode: When editing text fields in Vim-like Normal mode
c
Command Line mode: When typing into the &dactyl.appName; command line
+
o
Operator mode: When moving the cursor

@@ -65,7 +72,7 @@ prefixed with one of the above letters. For instance, :imap creates a new key mapping in Insert mode, while :cunmap removes a key mapping from Command Line mode. - Other modes can be specified using the -modes option described below. + Other modes can be specified using the -modes option described below.

@@ -142,16 +149,16 @@
-arg
Accept an argument after the requisite key press. Sets the arg parameter to the result. (short name -a)
-
-builtin
Execute this mapping as if there were no user-defined mappings (short name -b)
+
-builtin
Execute this mapping as if there were no user-defined mappings. (short name -b)
-count
Accept a count before the requisite key press. Sets the count parameter to the result. (short name -c)
-
-description
A description of this mapping (short name -d)
-
-ex
Execute rhs as an Ex command rather than keys (short name -e)
+
-description
A description of this mapping. (short name -d)
+
-ex
Execute rhs as an Ex command rather than keys. (short name -e)
-group=group
Add this command to the given group (short name -g). When listing commands this limits the output to the specified group.
-
-javascript
Execute rhs as JavaScript rather than keys (short names -js, -j)
+
-javascript
Execute rhs as JavaScript rather than keys. (short names -js, -j)
-literal=n
Parse the nth argument without specially processing any quote or meta characters. (short name -l)
-
-modes=modes
Create this mapping in the given modes (short names -mode, -m)
-
-nopersist
Do not save this mapping to an auto-generated rc file (short name -n)
-
-silent
Do not echo any generated keys to the command line (short name -s, also <silent> for Vim compatibility)
+
-modes=modes
Create this mapping in the given modes. (short names -mode, -m)
+
-nopersist
Do not save this mapping to an auto-generated rc file. (short name -n)
+
-silent
Do not echo any generated keys to the command line. (short name -s, also <silent> for Vim compatibility)
@@ -407,6 +414,71 @@ +

Mapping examples

+ +

Make do the same as in input modes:

+ +:map -b -m input + +

Toggle the tab line with :

+ +:map -ex always,never + +

Make toggle image display:

+ +:map -js <<EOF +let (pref = permissions.default.image) + prefs.set(pref, prefs.get(pref) == 1 ? 2 : 1); +tabs.reload(config.browser.mCurrentTab); +EOF + + +

Bypassing &dactyl.appName;

+ +&dactyl.appName; overrides nearly all &dactyl.host; keys in order to +make browsing more pleasant for Vim users. On the occasions when you +want to bypass &dactyl.appName;'s key handling and pass keys directly to +&dactyl.host; or to a web page, you have several options: + + + ]]> + ]]> + +

+ Process the next key as a builtin mapping, ignoring any user defined + mappings and passkeys settings. +

+
+
+ + + ]]> + ]]> + +

+ Pass the next key press directly to &dactyl.host;. +

+
+
+ + + ]]> + ]]> + +

+ Pass all keys except for directly to + &dactyl.host;. When is pressed, + resume normal key handling. This is especially useful + for web sites which make heavy use of key bindings. +

+
+
+ +

+ See also passkeys and passunknown for ways to permanently pass + all or particular keys under certain conditions. +

+

Abbreviations

@@ -600,7 +672,7 @@

By default, user commands accept no arguments. This can be changed by specifying - the -nargs option. + the -nargs option.

The valid values are:

@@ -618,7 +690,7 @@

Completion for arguments to user-defined commands is not available by default. Completion can be enabled by specifying one of the following arguments to the - -complete option when defining the command. + -complete option when defining the command.

@@ -627,7 +699,7 @@

Custom completion can be provided by specifying the - custom,thing argument to -complete. If + custom,thing argument to -complete. If thing evaluates to a function (i.e., it is a variable holding a function value, or a string containing the definition itself), it is called with two arguments: a completion context, and an object @@ -663,7 +735,7 @@

Count handling

- By default, user commands do not accept a count. Use the -count option if + By default, user commands do not accept a count. Use the -count option if you'd like to have a count passed to your user command. This will then be available for expansion as <count> in the replacement.

@@ -672,14 +744,14 @@

By default, a user command does not have a special version, i.e. a version - executed with the ! modifier. Providing the -bang option will enable this + executed with the ! modifier. Providing the -bang option will enable this and <bang> will be available in the replacement.

Command description

- The command's description text can be set with -description. Otherwise it will + The command's description text can be set with -description. Otherwise it will default to "User-defined command".

@@ -714,12 +786,21 @@ -

Examples

+

Command examples

+ +

A command to search via DuckDuckGo:

+ +:command -nargs=* ddg open ddg <args> -

Add a :Google command to search via google:

-:command -nargs=* Google open google <args> +

+ A command to search for contents of the current selection using a + tab-completed search engine in the current or a new tab (depending on how + much you bang on the keyboard): +

- +:com! search-selection,ss -bang -nargs=? -complete search + \ -js commands.execute((bang ? open : tabopen ) + \ + args + + buffer.currentWord)