From 80ab02746ba5dd65ffcce6c0c18aa66248481ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Sat, 1 Oct 2011 00:02:29 +0200 Subject: [PATCH] Add some example commands and mappings. --- common/locale/en-US/map.xml | 50 +++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/common/locale/en-US/map.xml b/common/locale/en-US/map.xml index f7c7305a..1237e106 100644 --- a/common/locale/en-US/map.xml +++ b/common/locale/en-US/map.xml @@ -37,12 +37,18 @@ For instance,

-: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.

@@ -408,6 +414,25 @@ +

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 @@ -761,12 +786,21 @@ want to bypass &dactyl.appName;'s key handling and pass keys directly to -

Examples

+

Command examples

-

Add a :Google command to search via google:

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

A command to search via DuckDuckGo:

- +:command -nargs=* ddg open ddg <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)