Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Improve emacs keybind with better home/end behavior (#21923)

Peter Tripp5d0e75dd7396
diff --git a/assets/keymaps/linux/emacs.json b/assets/keymaps/linux/emacs.json
index 64fb3f08316..c6accd38db2 100755
--- a/assets/keymaps/linux/emacs.json
+++ b/assets/keymaps/linux/emacs.json
@@ -15,8 +15,10 @@
"ctrl-b": "editor::MoveLeft",
"ctrl-n": "editor::MoveDown",
"ctrl-p": "editor::MoveUp",
- "ctrl-a": "editor::MoveToBeginningOfLine",
- "ctrl-e": "editor::MoveToEndOfLine",
+ "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
+ "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
+ "ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
+ "ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
"alt-f": "editor::MoveToNextSubwordEnd",
"alt-b": "editor::MoveToPreviousSubwordStart",
"ctrl-d": "editor::Delete",
@@ -53,6 +55,14 @@
"shift shift": "file_finder::Toggle"
}
},
+ {
+ "context": "BufferSearchBar > Editor",
+ "bindings": {
+ "ctrl-s": "search::SelectNextMatch",
+ "ctrl-r": "search::SelectPrevMatch",
+ "ctrl-g": "buffer_search::Dismiss"
+ }
+ },
{
"context": "Pane",
"bindings": {
diff --git a/assets/keymaps/macos/emacs.json b/assets/keymaps/macos/emacs.json
index c243aadfa83..c6accd38db2 100755
--- a/assets/keymaps/macos/emacs.json
+++ b/assets/keymaps/macos/emacs.json
@@ -15,8 +15,10 @@
"ctrl-b": "editor::MoveLeft",
"ctrl-n": "editor::MoveDown",
"ctrl-p": "editor::MoveUp",
- "ctrl-a": "editor::MoveToBeginningOfLine",
- "ctrl-e": "editor::MoveToEndOfLine",
+ "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
+ "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
+ "ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }],
+ "ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
"alt-f": "editor::MoveToNextSubwordEnd",
"alt-b": "editor::MoveToPreviousSubwordStart",
"ctrl-d": "editor::Delete",