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.

Support vim-mode in git commit editor (#33222)

Alvaro Parker2680a78f9cac
diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json
index 6b95839e2ae..b99b64c02d7 100644
--- a/assets/keymaps/vim.json
+++ b/assets/keymaps/vim.json
@@ -849,6 +849,25 @@
"shift-u": "git::UnstageAll"
}
},
+ {
+ "context": "Editor && mode == auto_height && VimControl",
+ "bindings": {
+ // TODO: Implement search
+ "/": null,
+ "?": null,
+ "#": null,
+ "*": null,
+ "n": null,
+ "shift-n": null
+ }
+ },
+ {
+ "context": "GitCommit > Editor && VimControl && vim_mode == normal",
+ "bindings": {
+ "ctrl-c": "menu::Cancel",
+ "escape": "menu::Cancel"
+ }
+ },
{
"context": "Editor && edit_prediction",
"bindings": {
@@ -860,14 +879,7 @@
{
"context": "MessageEditor > Editor && VimControl",
"bindings": {
- "enter": "agent::Chat",
- // TODO: Implement search
- "/": null,
- "?": null,
- "#": null,
- "*": null,
- "n": null,
- "shift-n": null
+ "enter": "agent::Chat"
}
},
{
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index dce3a52e0a5..51ef90fd382 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -388,6 +388,7 @@ pub(crate) fn commit_message_editor(
commit_editor.set_collaboration_hub(Box::new(project));
commit_editor.set_use_autoclose(false);
commit_editor.set_show_gutter(false, cx);
+ commit_editor.set_use_modal_editing(true);
commit_editor.set_show_wrap_guides(false, cx);
commit_editor.set_show_indent_guides(false, cx);
let placeholder = placeholder.unwrap_or("Enter commit message".into());