keymap: Add subword navigation and selection to Sublime Text keymap (#30268)
Fernando Carletti
and
Peter Tripp
created
For reference, this is what is set in Sublime Text's default-keymap
files for both MacOS and Linux:
```json
{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },
{ "keys": ["ctrl+right"], "command": "move", "args": {"by": "word_ends", "forward": true} },
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },
{ "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "word_ends", "forward": true, "extend": true} },
```
Release Notes:
- Add subword navigation and selection to Sublime keymap
Co-authored-by: Peter Tripp <peter@zed.dev>
Change summary
assets/keymaps/linux/sublime_text.json | 6 +++++-
assets/keymaps/macos/sublime_text.json | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
Detailed changes
@@ -51,7 +51,11 @@
"ctrl-k ctrl-l": "editor::ConvertToLowerCase",
"shift-alt-m": "markdown::OpenPreviewToTheSide",
"ctrl-backspace": "editor::DeleteToPreviousWordStart",
- "ctrl-delete": "editor::DeleteToNextWordEnd"
+ "ctrl-delete": "editor::DeleteToNextWordEnd",
+ "ctrl-right": "editor::MoveToNextSubwordEnd",
+ "ctrl-left": "editor::MoveToPreviousSubwordStart",
+ "ctrl-shift-right": "editor::SelectToNextSubwordEnd",
+ "ctrl-shift-left": "editor::SelectToPreviousSubwordStart"
}
},
{
@@ -53,7 +53,11 @@
"cmd-shift-j": "editor::JoinLines",
"shift-alt-m": "markdown::OpenPreviewToTheSide",
"ctrl-backspace": "editor::DeleteToPreviousWordStart",
- "ctrl-delete": "editor::DeleteToNextWordEnd"
+ "ctrl-delete": "editor::DeleteToNextWordEnd",
+ "ctrl-right": "editor::MoveToNextSubwordEnd",
+ "ctrl-left": "editor::MoveToPreviousSubwordStart",
+ "ctrl-shift-right": "editor::SelectToNextSubwordEnd",
+ "ctrl-shift-left": "editor::SelectToPreviousSubwordStart"
}
},
{