feat: add emacs style keybind for command palette (A-x)

A-x is also more likely tmux compatible
This commit is contained in:
CJ van den Berg 2024-10-15 09:52:09 +02:00
parent e710637f95
commit f631b672c4
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 4 additions and 2 deletions

View file

@ -153,6 +153,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'F' => self.cmd("move_word_right", .{}),
'S' => self.cmd("filter", command.fmt(.{"sort"})),
'V' => self.cmd("paste", .{}),
'X' => self.cmd("open_command_palette", .{}),
key.LEFT => self.cmd("jump_back", .{}),
key.RIGHT => self.cmd("jump_forward", .{}),
key.UP => self.cmd("pull_up", .{}),
@ -379,7 +380,7 @@ const hints = tui.KeybindHints.initComptime(.{
.{ "move_up", "up" },
.{ "move_word_left", "C-left, A-b" },
.{ "move_word_right", "C-right, A-f" },
.{ "open_command_palette", "C-S-p, S-A-p" },
.{ "open_command_palette", "C-S-p, S-A-p, A-x" },
.{ "open_file", "C-o" },
.{ "open_recent", "C-e" },
.{ "open_recent_project", "C-r" },

View file

@ -87,6 +87,7 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result {
'P' => self.cmd("goto_prev_file_or_diagnostic", .{}),
'L' => self.cmd("toggle_panel", .{}),
'I' => self.cmd("toggle_inputview", .{}),
'X' => self.cmd("open_command_palette", .{}),
key.LEFT => self.cmd("jump_back", .{}),
key.RIGHT => self.cmd("jump_forward", .{}),
else => {},
@ -160,7 +161,7 @@ const hints = tui.KeybindHints.initComptime(.{
.{ "open_file", "o, C-o" },
.{ "open_recent", "e, C-e" },
.{ "open_recent_project", "r, C-r" },
.{ "open_command_palette", "p, C-S-p, S-A-p" },
.{ "open_command_palette", "p, C-S-p, S-A-p, A-x" },
.{ "home_menu_activate", "enter" },
.{ "home_menu_down", "down" },
.{ "home_menu_up", "up" },