Docs Party 2024 (#15876)
Co-authored-by: Raunak Raj <nkray21111983@gmail.com> Co-authored-by: Thorsten Ball <mrnugget@gmail.com> Co-authored-by: Bennet <bennet@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com> Co-authored-by: Joseph T Lyons <JosephTLyons@gmail.com> Co-authored-by: Mikayla <mikayla@zed.dev> Co-authored-by: Jason <jason@zed.dev> Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Nathan Sobo <nathan@zed.dev> Co-authored-by: Jason Mancuso <7891333+jvmncs@users.noreply.github.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
co-authored by
Raunak Raj
Thorsten Ball
Bennet
Marshall Bowers
Joseph T Lyons
Mikayla
Jason
Antonio Scandurra
Max Brunsfeld
Marshall
Nathan Sobo
Jason Mancuso
Piotr Osiewicz
parent
c633fa5a10
commit
eb3c4b0e46
@@ -59,7 +59,7 @@ The keys can be any single unicode codepoint that your keyboard generates (for e
|
||||
|
||||
A few examples:
|
||||
|
||||
```
|
||||
```json
|
||||
"bindings": {
|
||||
"cmd-k cmd-s": "zed::OpenKeymap", // matches ⌘-k then ⌘-s
|
||||
"space e": "editor::Complete", // type space then e
|
||||
@@ -74,6 +74,37 @@ The `alt-` modifier can be used on many layouts to generate a different key. For
|
||||
|
||||
It is possible to match against typing a modifier key on its own. For example `shift shift` can be used to implement JetBrains search everywhere shortcut. In this case the binding happens on key release instead of key press.
|
||||
|
||||
### Contexts
|
||||
|
||||
Each key binding includes a `context` which determes when the key binding is active. If no context key is present it is considered to be in the `Global` context. The context is a boolean expression that can include the following:
|
||||
|
||||
- Pane
|
||||
- Workspace
|
||||
- Editor
|
||||
- Menu
|
||||
- Terminal
|
||||
- Assistant
|
||||
- ProjectPanel
|
||||
- ProjectSearch
|
||||
- BufferSearch
|
||||
- Search
|
||||
- Dock
|
||||
- EmptyPane
|
||||
- SharedScreen
|
||||
- VimControl
|
||||
- vim_mode == normal
|
||||
- vim_mode == visual
|
||||
- vim_mode == insert
|
||||
- vim_mode == replace
|
||||
- vim_mode == operator
|
||||
- vim_mode == waiting
|
||||
|
||||
<!--
|
||||
TBD: Improve keybinding contexts documentation https://github.com/zed-industries/zed/issues/14718
|
||||
-->
|
||||
|
||||
See also: [vim context docs](./vim.md#contexts)
|
||||
|
||||
### Remapping keys
|
||||
|
||||
A common request is to be able to map from one sequence of keys to another. As of Zed 0.124.0 you can do this with the `workspace::SendKeystrokes` action.
|
||||
@@ -102,7 +133,7 @@ A common request is to be able to map from one sequence of keys to another. As o
|
||||
There are some limitations to this, notably:
|
||||
|
||||
- Any asynchronous operation will not happen until after all your key bindings have been dispatched. For example this means that while you can use a binding to open a file (as in the `cmd-alt-r` example) you cannot send further keystrokes and hope to have them interpreted by the new view.
|
||||
- - Other examples of asynchronous things are: communicating with a language server, changing the language of a buffer, anything that hits the network.
|
||||
- Other examples of asynchronous things are: communicating with a language server, changing the language of a buffer, anything that hits the network.
|
||||
- There is a limit of 100 simulated keys at a time, this is to avoid accidental infinite recursion if you trigger SendKeystrokes again inside your bindings.
|
||||
|
||||
The argument to `SendKeystrokes` is a space-separated list of keystrokes (using the same syntax as above). Due to the way that keystrokes are parsed, any segment that is not recognized as a keypress will be sent verbatim to the currently focused input field.
|
||||
@@ -125,12 +156,15 @@ For example, `ctrl-n` creates a new tab in Zed on Linux. If you want to send `ct
|
||||
### Task Key bindings
|
||||
|
||||
You can also bind keys to launch Zed Tasks defined in your tasks.json.
|
||||
See the [tasks documentation](/docs/tasks#custom-keybindings-for-tasks) for more.
|
||||
See the [tasks documentation](tasks.md#custom-keybindings-for-tasks) for more.
|
||||
|
||||
### All key bindings
|
||||
|
||||
#### Global
|
||||
|
||||
TBD: Update these to reflect current bindings
|
||||
TBD: Add Column with Linux shortcuts
|
||||
|
||||
| **Command** | **Target** | **Default Shortcut** |
|
||||
| ------------------------- | ------------ | ----------------------- |
|
||||
| Toggle focus | Collab Panel | `⌘ + Shift + C` |
|
||||
|
||||
Reference in New Issue
Block a user