diff --git a/docs/src/key-bindings.md b/docs/src/key-bindings.md index e3612a12120f683df4b91259be920750e46226c8..41040566e5d44845e138f31db1d18245259aa13c 100644 --- a/docs/src/key-bindings.md +++ b/docs/src/key-bindings.md @@ -44,6 +44,36 @@ If you use the JetBrains base keymap, Zed makes editor-local `alt-left` / `alt-r If you want to customize this behavior further, open the keymap editor with {#kb zed::OpenKeymap} or edit your `keymap.json` directly. +If you are using a base keymap other than JetBrains and want `alt-left` / `alt-right` to use CamelHump-style subword motions, add this to your `keymap.json`: + +```json [keymap] +[ + { + "context": "Editor", + "bindings": { + "alt-left": "editor::MoveToPreviousSubwordStart", + "alt-right": "editor::MoveToNextSubwordEnd", + "shift-alt-left": "editor::SelectToPreviousSubwordStart", + "shift-alt-right": "editor::SelectToNextSubwordEnd" + } + } +] +``` + +If you use the JetBrains base keymap and want `alt-left` / `alt-right` to keep moving between tabs in the editor, add this override: + +```json [keymap] +[ + { + "context": "Editor", + "bindings": { + "alt-left": "pane::ActivatePreviousItem", + "alt-right": "pane::ActivateNextItem" + } + } +] +``` + ## Keymap Editor You can access the keymap editor through the {#kb zed::OpenKeymap} action or by running {#action zed::OpenKeymap} action from the command palette. You can easily add or change a keybind for an action with the `Change Keybinding` or `Add Keybinding` button on the command pallets left bottom corner. diff --git a/docs/src/migrate/intellij.md b/docs/src/migrate/intellij.md index ddb2bc4f6b0aaf4b7c878594b8e553a921481341..024c3d42cd0f6d7725dfdcc4c8b8b75856d6dabb 100644 --- a/docs/src/migrate/intellij.md +++ b/docs/src/migrate/intellij.md @@ -45,6 +45,8 @@ This maps familiar shortcuts like `Shift Shift` for Search Everywhere, `Cmd+O` f In editors, the JetBrains keymap also makes `Alt+Left` / `Alt+Right` and `Shift+Alt+Left` / `Shift+Alt+Right` move and select by subword, so identifiers like `camelCase` and `snake_case` behave like IntelliJ's CamelHumps navigation. +If you want to copy that behavior into another base keymap, see the copy-paste `keymap.json` examples in [Key Bindings](../key-bindings.md#word-and-subword-navigation). + ## Set Up Editor Preferences You can configure most settings in the Settings Editor ({#kb zed::OpenSettings}). For advanced settings, run `zed: open settings file` from the Command Palette to edit your settings file directly. diff --git a/docs/src/migrate/pycharm.md b/docs/src/migrate/pycharm.md index a7a5e7829c350bdaff7c397b5a589bc9e740ec57..37728a349af81df79dab044a1c48c5db11a4c5bc 100644 --- a/docs/src/migrate/pycharm.md +++ b/docs/src/migrate/pycharm.md @@ -45,6 +45,8 @@ This maps familiar shortcuts like `Shift Shift` for Search Everywhere, `Cmd+O` f In editors, the JetBrains keymap also makes `Alt+Left` / `Alt+Right` and `Shift+Alt+Left` / `Shift+Alt+Right` move and select by subword, so identifiers like `camelCase` and `snake_case` behave like PyCharm's CamelHumps navigation. +If you want to copy that behavior into another base keymap, see the copy-paste `keymap.json` examples in [Key Bindings](../key-bindings.md#word-and-subword-navigation). + ## Set Up Editor Preferences You can configure most settings in the Settings Editor ({#kb zed::OpenSettings}). For advanced settings, run `zed: open settings file` from the Command Palette to edit your settings file directly. diff --git a/docs/src/migrate/rustrover.md b/docs/src/migrate/rustrover.md index 8cd33641b3890e67f71fcb8b4af7fb6e4446928c..a94acd4771387826086943cb2944c632a347e2e9 100644 --- a/docs/src/migrate/rustrover.md +++ b/docs/src/migrate/rustrover.md @@ -45,6 +45,8 @@ This maps familiar shortcuts like `Shift Shift` for Search Everywhere, `Cmd+O` f In editors, the JetBrains keymap also makes `Alt+Left` / `Alt+Right` and `Shift+Alt+Left` / `Shift+Alt+Right` move and select by subword, so identifiers like `camelCase` and `snake_case` behave like RustRover's CamelHumps navigation. +If you want to copy that behavior into another base keymap, see the copy-paste `keymap.json` examples in [Key Bindings](../key-bindings.md#word-and-subword-navigation). + ## Set Up Editor Preferences You can configure most settings in the Settings Editor ({#kb zed::OpenSettings}). For advanced settings, run `zed: open settings file` from the Command Palette to edit your settings file directly. diff --git a/docs/src/migrate/webstorm.md b/docs/src/migrate/webstorm.md index ac3bc06c106e5ff451f908221cdc29b145a23186..2b37cb513207bb8ad0c104d6f2ade3ab1e0d8a60 100644 --- a/docs/src/migrate/webstorm.md +++ b/docs/src/migrate/webstorm.md @@ -45,6 +45,8 @@ This maps familiar shortcuts like `Shift Shift` for Search Everywhere, `Cmd+O` f In editors, the JetBrains keymap also makes `Alt+Left` / `Alt+Right` and `Shift+Alt+Left` / `Shift+Alt+Right` move and select by subword, so identifiers like `camelCase` and `snake_case` behave like WebStorm's CamelHumps navigation. +If you want to copy that behavior into another base keymap, see the copy-paste `keymap.json` examples in [Key Bindings](../key-bindings.md#word-and-subword-navigation). + ## Set Up Editor Preferences You can configure most settings in the Settings Editor ({#kb zed::OpenSettings}). For advanced settings, run `zed: open settings file` from the Command Palette to edit your settings file directly.