Update documentation, mention ':help key' everywhere

This commit is contained in:
glacambre 2018-06-07 12:52:11 +02:00
parent 37785508e1
commit 31805b7c7f
No known key found for this signature in database
GPG key ID: B9625DB1767553AC
4 changed files with 20 additions and 1 deletions

View file

@ -31,6 +31,8 @@ This is a (non-exhaustive) list of the most common normal-mode bindings. Type `:
* `ZZ` — close all tabs and windows, but only "save" them if your about:preferences are set to "show your tabs and windows from last time"
* `.` — repeat the last command
You can try `:help key` to know more about `key`. If it is an existing binding, it will take you to the help section of the command that will be executed when pressing `key`. For example `:help .` will take you to the help section of the `repeat` command.
#### Navigating with the current page
* `j`/`k` — scroll down/up

View file

@ -900,7 +900,13 @@ export function home(all: "false" | "true" = "false") {
/** Show this page.
`:help <excmd>` jumps to the entry for that command.
`:help something` jumps to the entry for something. Something can be an excmd, an alias for an excmd or a binding.
The "nmaps" list is a list of all the bindings for the command you're seeing and the "exaliases" list lists all its aliases.
If there's a conflict (e.g. you have a "go" binding that does something and also a "go" excmd that does something else), the binding has higher priority.
If the keyword you gave to `:help` is actually an alias for a composite command (see [[composite]]) , you will be taken to the help section for the first command of the pipeline. You will be able to see the whole pipeline by hovering your mouse over the alias in the "exaliases" list. Unfortunately there currently is now way to display these HTML tooltips from the keyboard.
e.g. `:help bind`
*/
@ -910,14 +916,21 @@ export async function help(excmd?: string) {
if (excmd === undefined) excmd = ""
else {
let bindings = await config.getAsync("nmaps")
// If 'excmd' matches a binding, replace 'excmd' with the command that would be executed when pressing the key sequence referenced by 'excmd'
if (excmd in bindings) {
excmd = bindings[excmd].split(" ")
excmd = ["composite", "fillcmdline"].includes(excmd[0]) ? excmd[1] : excmd[0]
}
let aliases = await config.getAsync("exaliases")
// As long as excmd is an alias, try to resolve this alias to a real excmd
let resolved = []
while (aliases[excmd]) {
resolved.push(excmd)
excmd = aliases[excmd].split(" ")
excmd = excmd[0] == "composite" ? excmd[1] : excmd[0]
// Prevent infinite loops
if (resolved.includes(excmd)) break
}
}
if ((await activeTab()).url.startsWith(docpage)) {

View file

@ -7,6 +7,7 @@ Command mode, i.e, "the console", is used for accessing less frequently used com
* `viewsource` to view the current page's source
* `viewconfig nmaps` to view the current normal mode bindings
* `help [command]` to access help on a command
* `help [key]` to access help on an existing binding
* `composite [command 1]; [command 2]; [command 3]...` lets you execute commands sequentially, useful for binding. If you want the results of each command to be piped to the other, use pipes `|` instead of semi-colons.
We support a handful of keybinds in the console:

View file

@ -37,6 +37,7 @@ REPLACE_ME_WITH_THE_CHANGE_LOG_USING_SED
* `[[`/`]]` — navigate forward/backward though paginated pages.
* `ZZ` — close all tabs and windows, but it will only "save" them if your about:preferences are set to "show your tabs and windows from last time".
* [`:help hint`][help-hint] to see all the other useful hint modes (this is the `f` magic. :) ).
* `:help <keybinding>` to learn more about what a specific key binding does.
## Important limitations due to WebExtensions
@ -54,6 +55,8 @@ Tridactyl overrides your newtab page because it cannot insert its content script
* `:set newtab [URL]`
* e.g, `:set newtab about:blank`
Also, if you want to use a new tab page provided by another extension, make sure to install said extension after Tridactyl. Uninstalling and re-installing the other extension should work too.
## FAQ
You have more questions? Have a look at our [FAQ][faq-link].