feat: add alternate keybinding for command palette
For terminals that block C-S-p.
This commit is contained in:
parent
5cc944f0e4
commit
394874fb20
6 changed files with 17 additions and 4 deletions
|
@ -159,6 +159,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result {
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
mod.ALT | mod.SHIFT => switch (keynormal) {
|
mod.ALT | mod.SHIFT => switch (keynormal) {
|
||||||
|
'P' => self.cmd("open_command_palette", .{}),
|
||||||
'D' => self.cmd("dupe_up", .{}),
|
'D' => self.cmd("dupe_up", .{}),
|
||||||
// 'B' => self.cmd("select_word_left", .{}),
|
// 'B' => self.cmd("select_word_left", .{}),
|
||||||
// 'F' => self.cmd("select_word_right", .{}),
|
// 'F' => self.cmd("select_word_right", .{}),
|
||||||
|
@ -363,7 +364,7 @@ const hints = tui.KeybindHints.initComptime(.{
|
||||||
.{ "move_up", "up" },
|
.{ "move_up", "up" },
|
||||||
.{ "move_word_left", "C-left, A-b" },
|
.{ "move_word_left", "C-left, A-b" },
|
||||||
.{ "move_word_right", "C-right, A-f" },
|
.{ "move_word_right", "C-right, A-f" },
|
||||||
.{ "open_command_palette", "C-S-p" },
|
.{ "open_command_palette", "C-S-p, S-A-p" },
|
||||||
.{ "open_recent", "C-e" },
|
.{ "open_recent", "C-e" },
|
||||||
.{ "paste", "A-v" },
|
.{ "paste", "A-v" },
|
||||||
.{ "pop_cursor", "C-u" },
|
.{ "pop_cursor", "C-u" },
|
||||||
|
|
|
@ -75,6 +75,10 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result {
|
||||||
'/' => self.cmd("open_help", .{}),
|
'/' => self.cmd("open_help", .{}),
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
|
mod.ALT | mod.SHIFT => switch (keynormal) {
|
||||||
|
'P' => self.cmd("open_command_palette", .{}),
|
||||||
|
else => {},
|
||||||
|
},
|
||||||
mod.ALT => switch (keynormal) {
|
mod.ALT => switch (keynormal) {
|
||||||
'L' => self.cmd("toggle_logview", .{}),
|
'L' => self.cmd("toggle_logview", .{}),
|
||||||
'I' => self.cmd("toggle_inputview", .{}),
|
'I' => self.cmd("toggle_inputview", .{}),
|
||||||
|
@ -130,7 +134,7 @@ const hints = tui.KeybindHints.initComptime(.{
|
||||||
.{ "enter_find_in_files_mode", "C-S-f" },
|
.{ "enter_find_in_files_mode", "C-S-f" },
|
||||||
.{ "enter_open_file_mode", "o, C-o" },
|
.{ "enter_open_file_mode", "o, C-o" },
|
||||||
.{ "open_recent", "e, C-e" },
|
.{ "open_recent", "e, C-e" },
|
||||||
.{ "open_command_palette", "p, C-S-p" },
|
.{ "open_command_palette", "p, C-S-p, S-A-p" },
|
||||||
.{ "home_menu_activate", "enter" },
|
.{ "home_menu_activate", "enter" },
|
||||||
.{ "home_menu_down", "down" },
|
.{ "home_menu_down", "down" },
|
||||||
.{ "home_menu_up", "up" },
|
.{ "home_menu_up", "up" },
|
||||||
|
|
|
@ -161,6 +161,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result {
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
mod.ALT | mod.SHIFT => switch (keynormal) {
|
mod.ALT | mod.SHIFT => switch (keynormal) {
|
||||||
|
'P' => self.cmd("open_command_palette", .{}),
|
||||||
'D' => self.cmd("dupe_up", .{}),
|
'D' => self.cmd("dupe_up", .{}),
|
||||||
'F' => self.cmd("filter", command.fmt(.{ "zig", "fmt", "--stdin" })),
|
'F' => self.cmd("filter", command.fmt(.{ "zig", "fmt", "--stdin" })),
|
||||||
'S' => self.cmd("filter", command.fmt(.{ "sort", "-u" })),
|
'S' => self.cmd("filter", command.fmt(.{ "sort", "-u" })),
|
||||||
|
|
|
@ -166,6 +166,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result {
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
mod.ALT | mod.SHIFT => switch (keynormal) {
|
mod.ALT | mod.SHIFT => switch (keynormal) {
|
||||||
|
'P' => self.cmd("open_command_palette", .{}),
|
||||||
'D' => self.cmd("dupe_up", .{}),
|
'D' => self.cmd("dupe_up", .{}),
|
||||||
'F' => self.cmd("filter", command.fmt(.{ "zig", "fmt", "--stdin" })),
|
'F' => self.cmd("filter", command.fmt(.{ "zig", "fmt", "--stdin" })),
|
||||||
'S' => self.cmd("filter", command.fmt(.{ "sort", "-u" })),
|
'S' => self.cmd("filter", command.fmt(.{ "sort", "-u" })),
|
||||||
|
@ -552,7 +553,7 @@ const hints = tui.KeybindHints.initComptime(.{
|
||||||
.{ "move_word_left", "C-left, A-b, b" },
|
.{ "move_word_left", "C-left, A-b, b" },
|
||||||
.{ "move_word_right", "C-right, A-f, e" },
|
.{ "move_word_right", "C-right, A-f, e" },
|
||||||
.{ "move_word_right_vim", "w" },
|
.{ "move_word_right_vim", "w" },
|
||||||
.{ "open_command_palette", "C-S-p, :, S-;" },
|
.{ "open_command_palette", "C-S-p, :, S-;, S-A-p" },
|
||||||
.{ "open_recent", "C-e" },
|
.{ "open_recent", "C-e" },
|
||||||
.{ "paste", "A-v, p" },
|
.{ "paste", "A-v, p" },
|
||||||
.{ "pop_cursor", "C-u" },
|
.{ "pop_cursor", "C-u" },
|
||||||
|
|
|
@ -166,6 +166,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result {
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
mod.ALT | mod.SHIFT => switch (keynormal) {
|
mod.ALT | mod.SHIFT => switch (keynormal) {
|
||||||
|
'P' => self.cmd("open_command_palette", .{}),
|
||||||
'D' => self.cmd("dupe_up", .{}),
|
'D' => self.cmd("dupe_up", .{}),
|
||||||
'F' => self.cmd("filter", command.fmt(.{ "zig", "fmt", "--stdin" })),
|
'F' => self.cmd("filter", command.fmt(.{ "zig", "fmt", "--stdin" })),
|
||||||
'S' => self.cmd("filter", command.fmt(.{ "sort", "-u" })),
|
'S' => self.cmd("filter", command.fmt(.{ "sort", "-u" })),
|
||||||
|
@ -512,7 +513,7 @@ const hints = tui.KeybindHints.initComptime(.{
|
||||||
.{ "move_word_left", "C-left, A-b, b" },
|
.{ "move_word_left", "C-left, A-b, b" },
|
||||||
.{ "move_word_right", "C-right, A-f, e" },
|
.{ "move_word_right", "C-right, A-f, e" },
|
||||||
.{ "move_word_right_vim", "w" },
|
.{ "move_word_right_vim", "w" },
|
||||||
.{ "open_command_palette", "C-S-p, :, S-;" },
|
.{ "open_command_palette", "C-S-p, :, S-;, S-A-p" },
|
||||||
.{ "open_recent", "C-e" },
|
.{ "open_recent", "C-e" },
|
||||||
.{ "paste", "A-v, p" },
|
.{ "paste", "A-v, p" },
|
||||||
.{ "pop_cursor", "C-u" },
|
.{ "pop_cursor", "C-u" },
|
||||||
|
|
|
@ -207,7 +207,12 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result {
|
||||||
'I' => self.cmd_async("toggle_inputview"),
|
'I' => self.cmd_async("toggle_inputview"),
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
|
mod.ALT | mod.SHIFT => switch (keynormal) {
|
||||||
|
'P' => self.cmd("command_palette_menu_down", .{}),
|
||||||
|
else => {},
|
||||||
|
},
|
||||||
mod.ALT => switch (keynormal) {
|
mod.ALT => switch (keynormal) {
|
||||||
|
'P' => self.cmd("command_palette_menu_up", .{}),
|
||||||
'L' => self.cmd("toggle_logview", .{}),
|
'L' => self.cmd("toggle_logview", .{}),
|
||||||
'I' => self.cmd("toggle_inputview", .{}),
|
'I' => self.cmd("toggle_inputview", .{}),
|
||||||
else => {},
|
else => {},
|
||||||
|
|
Loading…
Add table
Reference in a new issue