diff --git a/doc/amo.md b/doc/amo.md index 5425c448..0e5d0891 100644 --- a/doc/amo.md +++ b/doc/amo.md @@ -7,6 +7,7 @@ Replace Firefox's control mechanism with one modelled on VIM. This is a "Firefox - You want to go to the bottom of the page? Hit `G`. Or the top? `gg`. - You want to focus the text field on Wikipedia to search for another term? `gi`. - Switch to the next tab? `gt`. +- Got trapped in a place where Tridactyl can't run? `Ctrl-,` - Go back in time? `H`. - Notice that this tab is rubbish and you want to close it? `d`. - Regret that decision? `u` restores it. diff --git a/src/excmds.ts b/src/excmds.ts index 4722c6df..b4199303 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -3297,6 +3297,12 @@ export function comclear(name: string) { You can bind to other modes with `bind --mode={insert|ignore|normal|input|ex|hint} ...`, e.g, `bind --mode=insert emacs qall` (NB: unlike vim, all preceeding characters will not be input), or `bind --mode=hint hint.reset`. + `bind --mode=browser [key sequence] [ex command]` binds to a special mode which can be accessed all the time in all browser tabs - even tabs in which Tridactyl cannot run. It comes with a few caveats: + + - you may only have a few browser-mode binds at once. At the time of writing, this is 8, with 3 initially taken by Tridactyl. If you desperately need more, file an [[issue]]. + - the key sequence must consist of a single, simple key with at least one and no more than two modifiers. An error will be thrown if you try to bind to an invalid key sequence. + - the `ex command` you bind to may not work fully unless you are on a tab which Tridactyl has access to. Generally, browser-wide actions like making or closing tabs will work but tab-specific actions like scrolling down or entering hint mode will not. + A list of editor functions can be found [here](/static/docs/modules/_src_lib_editor_.html). diff --git a/src/static/clippy/2-normal_mode.md b/src/static/clippy/2-normal_mode.md index 534766e3..05fd0b38 100644 --- a/src/static/clippy/2-normal_mode.md +++ b/src/static/clippy/2-normal_mode.md @@ -12,24 +12,35 @@ Many keypresses in normal mode take you into another mode. `t`, for example, put ## Useful normal mode keybinds -* `b` brings up a list of your current tabs. Press `Tab`/`Shift-Tab` to cycle through them and enter to select. You can also type to filter down the tabs based on their titles and URLs -* Opening web pages: - * `w` opens URLs in new windows - * `o` in the current tab - * `t` in a new tab - * Using a capital letter in place of any of the previous commands opens the command with the current URL pasted into it, i.e, `W`,`O`,`T` - * `s` lets you search easily - * in general, you can search many search engines straight from these prompts by simply starting your query with the search engine, such as `bing` `duckduckgo` or `scholar` -* Navigate history with `H` and `L` -* `yy` copies the current URL to your clipboard -* `p` opens the clipboard contents as a web page, or searches for it, in the current tab. `P` opens it in a new tab - * Protip: quickly search for the source of a quote by using `;p` to copy a paragraph, and `P` to search the internet for it -* `zi`,`zo`,`zz` zoom in, out and return to the default zoom -* Search text with Firefox's standard `/` binding, jump from match to match with `` or `` (note that it isn't possible to rebind searching/jumping between matches for now). If you want to use Firefox's `` search you'll have to run `unbind `. -- `` sends the next keystroke to the current website, bypassing bindings +- `b` brings up a list of your current tabs. Press `Tab`/`Shift-Tab` to cycle through them and enter to select. You can also type to filter down the tabs based on their titles and URLs +- Opening web pages: + - `w` opens URLs in new windows + - `o` in the current tab + - `t` in a new tab + - Using a capital letter in place of any of the previous commands opens the command with the current URL pasted into it, i.e, `W`,`O`,`T` + - `s` lets you search easily + - in general, you can search many search engines straight from these prompts by simply starting your query with the search engine, such as `bing` `duckduckgo` or `scholar` +- Navigate history with `H` and `L` +- `yy` copies the current URL to your clipboard +- `p` opens the clipboard contents as a web page, or searches for it, in the current tab. `P` opens it in a new tab + - Protip: quickly search for the source of a quote by using `;p` to copy a paragraph, and `P` to search the internet for it +- `zi`,`zo`,`zz` zoom in, out and return to the default zoom +- Search text with Firefox's standard `/` binding, jump from match to match with `` or `` (note that it isn't possible to rebind searching/jumping between matches for now). If you want to use Firefox's `` search you'll have to run `unbind `. + +* `` sends the next keystroke to the current website, bypassing bindings All the keys in normal mode are bound to commands; for example, `j` is bound to `scrolline 10`. If you are ever curious as to what a key sequence does in normal mode, you can simply use `:bind [keys]` and the command line will tell you to which command they are bound. +## Browser-wide binds + +By default, there are three browser "mode" binds: `` to `:escapehatch`, and `` and `` to `:tab #`. These binds are accessible in all modes and anywhere within Firefox - even on pages where Tridactyl cannot run. New browser mode binds can be added with `:bind --mode=browser [ex command]`. Note that any ex-commands which require access to the page you are on will fail to run if Tridactyl does not have access to that page. The best thing to do is to try it and see. + +There are quite a few caveats with these binds - see `:help bind` for more details. + +Unbind the binds with `unbind --mode=browser [key]`. + +--- + The [next page](./3-hint_mode.html) will explain how to use some of the various hint modes. This time try `]]` (guess the next page) to follow the link. diff --git a/src/static/newtab.md b/src/static/newtab.md index f0573a35..a2c2dd15 100644 --- a/src/static/newtab.md +++ b/src/static/newtab.md @@ -29,8 +29,8 @@ REPLACE_ME_WITH_THE_CHANGE_LOG_USING_SED - `t`/`T` — open a URL in a new tab (`T` to pre-load current URL). - `gt`/`gT` — go to the next/previous tab. - `d` — close the current tab. +- `` — "escape hatch": get to a place where you can use Tridactyl. Works anywhere in the browser. - `/` — open the find search box. Use ctrl + g/G to cycle through search results. -- `A` — bookmark the current page - `b` — bring up a list of open tabs in the current window. - `s` — if you want to search for something that looks like a domain name or URL. - `gi` — scroll to and focus the last-used input on the page.