diff options
author | Canop <cano.petrole@gmail.com> | 2019-09-13 20:18:20 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2019-09-13 20:18:20 +0200 |
commit | 73798a356620f96364f980693fab88926c9fb7a8 (patch) | |
tree | bf0fe128dcb75730ce9702458fb91438da3d140e /website | |
parent | f6b709b6165ef77e0c5c577df1cc01a85920c192 (diff) |
allow configuration of keyboard keys for verb triggering
Fix #68
Diffstat (limited to 'website')
-rw-r--r-- | website/docs/documentation/configuration.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/website/docs/documentation/configuration.md b/website/docs/documentation/configuration.md index fef53dc..564a1a6 100644 --- a/website/docs/documentation/configuration.md +++ b/website/docs/documentation/configuration.md @@ -20,6 +20,7 @@ You can define a new verb in the TOML configuration file with a `[[verbs]]` sect [[verbs]] invocation = "edit" + key = "F2" shortcut = "e" execution = "/usr/bin/nvim {file}" @@ -29,6 +30,7 @@ name | mandatory | role -|-|- invocation | yes | how the verb is called by the user, with placeholders for arguments execution | yes | how the verb is executed +key | no | a keyboard key triggerring execution shorcut | no | an alternate way to call the verb (without the arguments part) leave_broot | no | whether to quit broot on execution (default: `true`) from_shell | no | whether the verb must be executed from the parent shell (needs `br`, default: `false`) @@ -54,6 +56,41 @@ Its interest is that if you do `:p`, then `enter`, it is executed even while the Use shortcuts for verbs you frequently use. +### Keyboard key + +The main keys you can use are + +* The function keys (for example `"F3"`) +* Ctrl and Alt keys (for example `"^T"` `"alt-a"`) + +It's possible to define a verb just to add a trigger key to an internal verb. + +For example you could add those mappings: + + [[verbs]] + invocation = "root" + key = "F9" + execution = ":focus_root" + + [[verbs]] + invocation = "home" + key = "ctrl-H" + execution = ":focus_user_home" + + [[verbs]] + invocation = "top" + key = "F6" + execution = ":select_first" + + [[verbs]] + invocation = "bottom" + key = "F7" + execution = ":select_last" + +Then, when doing <key>Ctrl-H</key>, you would go to you user home (`~` when on linux) and <key>F7</key> would select the last line of the tree. + +Beware that consoles often intercept some possible keys. + ### Verbs not leaving broot If you set `leave_broot = false`, broot won't quit when executing your command, but it will update the tree. |