refactor: clean-up command naming

This commit is contained in:
CJ van den Berg 2024-08-18 17:59:28 +02:00
parent f9c029f617
commit ea31e414ee
11 changed files with 55 additions and 55 deletions

View file

@ -85,21 +85,21 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'Z' => self.cmd("undo", .{}),
'Y' => self.cmd("redo", .{}),
'Q' => self.cmd("quit", .{}),
'O' => self.cmd("enter_open_file_mode", .{}),
'O' => self.cmd("open_file", .{}),
'W' => self.cmd("close_file", .{}),
'S' => self.cmd("save_file", .{}),
'L' => self.cmd_cycle3("scroll_view_center", "scroll_view_top", "scroll_view_bottom", .{}),
'N' => self.cmd("goto_next_match", .{}),
'P' => self.cmd("goto_prev_match", .{}),
'B' => self.cmd("enter_move_to_char_mode", command.fmt(.{false})),
'T' => self.cmd("enter_move_to_char_mode", command.fmt(.{true})),
'B' => self.cmd("move_to_char", command.fmt(.{false})),
'T' => self.cmd("move_to_char", command.fmt(.{true})),
'X' => self.cmd("cut", .{}),
'C' => self.cmd("copy", .{}),
'V' => self.cmd("system_paste", .{}),
'U' => self.cmd("pop_cursor", .{}),
'K' => self.leader = .{ .keypress = keynormal, .modifiers = modifiers },
'F' => self.cmd("enter_find_mode", .{}),
'G' => self.cmd("enter_goto_mode", .{}),
'F' => self.cmd("find", .{}),
'G' => self.cmd("goto", .{}),
'D' => self.cmd("add_cursor_next_match", .{}),
'A' => self.cmd("select_all", .{}),
'I' => self.insert_bytes("\t"),
@ -126,7 +126,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'Z' => self.cmd("redo", .{}),
'Q' => self.cmd("quit_without_saving", .{}),
'W' => self.cmd("close_file_without_saving", .{}),
'F' => self.cmd("enter_find_in_files_mode", .{}),
'F' => self.cmd("find_in_files", .{}),
'L' => self.cmd_async("add_cursor_all_matches"),
'I' => self.cmd_async("toggle_inspector_view"),
'M' => self.cmd("show_diagnostics", .{}),
@ -330,11 +330,11 @@ const hints = tui.KeybindHints.initComptime(.{
.{ "dupe_up", "S-A-d" },
.{ "enable_fast_scroll", "hold Ctrl" },
.{ "enable_jump_mode", "hold Alt" },
.{ "enter_find_in_files_mode", "C-S-f" },
.{ "enter_find_mode", "C-f" },
.{ "enter_goto_mode", "C-g" },
.{ "enter_move_to_char_mode", "C-b, C-t" }, // true/false
.{ "enter_open_file_mode", "C-o" },
.{ "find_in_files", "C-S-f" },
.{ "find", "C-f" },
.{ "goto", "C-g" },
.{ "move_to_char", "C-b, C-t" }, // true/false
.{ "open_file", "C-o" },
.{ "filter", "A-s" }, // self.cmd("filter", command.fmt(.{"sort"})),
// .{ "filter", "S-A-s" }, // self.cmd("filter", command.fmt(.{ "sort", "-u" })),
.{ "format", "S-A-f" },

View file

@ -61,7 +61,7 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result {
'J' => self.cmd("toggle_panel", .{}),
'Q' => self.cmd("quit", .{}),
'W' => self.cmd("quit", .{}),
'O' => self.cmd("enter_open_file_mode", .{}),
'O' => self.cmd("open_file", .{}),
'E' => self.cmd("open_recent", .{}),
'P' => self.cmd("open_command_palette", .{}),
'/' => self.cmd("open_help", .{}),
@ -72,7 +72,7 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result {
'P' => self.cmd("open_command_palette", .{}),
'Q' => self.cmd("quit_without_saving", .{}),
'R' => self.cmd("restart", .{}),
'F' => self.cmd("enter_find_in_files_mode", .{}),
'F' => self.cmd("find_in_files", .{}),
'L' => self.cmd_async("toggle_panel"),
'/' => self.cmd("open_help", .{}),
else => {},
@ -92,7 +92,7 @@ fn mapPress(self: *Self, keypress: u32, modifiers: u32) tp.result {
},
0 => switch (keypress) {
'h' => self.cmd("open_help", .{}),
'o' => self.cmd("enter_open_file_mode", .{}),
'o' => self.cmd("open_file", .{}),
'e' => self.cmd("open_recent", .{}),
'r' => self.msg("open recent project not implemented"),
'p' => self.cmd("open_command_palette", .{}),
@ -154,8 +154,8 @@ fn sheeran(self: *Self) void {
}
const hints = tui.KeybindHints.initComptime(.{
.{ "enter_find_in_files_mode", "C-S-f" },
.{ "enter_open_file_mode", "o, C-o" },
.{ "find_in_files", "C-S-f" },
.{ "open_file", "o, C-o" },
.{ "open_recent", "e, C-e" },
.{ "open_command_palette", "p, C-S-p, S-A-p" },
.{ "home_menu_activate", "enter" },

View file

@ -97,14 +97,14 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'L' => self.cmd_cycle3("scroll_view_center", "scroll_view_top", "scroll_view_bottom", .{}),
'N' => self.cmd("goto_next_match", .{}),
'P' => self.cmd("goto_prev_match", .{}),
'B' => self.cmd("enter_move_to_char_mode", command.fmt(.{false})),
'T' => self.cmd("enter_move_to_char_mode", command.fmt(.{true})),
'B' => self.cmd("move_to_char", command.fmt(.{false})),
'T' => self.cmd("move_to_char", command.fmt(.{true})),
'X' => self.cmd("cut", .{}),
'C' => self.cmd("enter_mode", command.fmt(.{"vim/normal"})),
'V' => self.cmd("system_paste", .{}),
'K' => self.leader = .{ .keypress = keynormal, .modifiers = modifiers },
'F' => self.cmd("enter_find_mode", .{}),
'G' => self.cmd("enter_goto_mode", .{}),
'F' => self.cmd("find", .{}),
'G' => self.cmd("goto", .{}),
'O' => self.cmd("run_ls", .{}),
'A' => self.cmd("select_all", .{}),
'I' => self.insert_bytes("\t"),
@ -131,7 +131,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'Z' => self.cmd("redo", .{}),
'Q' => self.cmd("quit_without_saving", .{}),
'W' => self.cmd("close_file_without_saving", .{}),
'F' => self.cmd("enter_find_in_files_mode", .{}),
'F' => self.cmd("find_in_files", .{}),
'L' => self.cmd_async("add_cursor_all_matches"),
'I' => self.cmd_async("toggle_inspector_view"),
key.ENTER => self.cmd("smart_insert_line_before", .{}),

View file

@ -104,14 +104,14 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'L' => self.cmd_cycle3("scroll_view_center", "scroll_view_top", "scroll_view_bottom", .{}),
'N' => self.cmd("goto_next_match", .{}),
'P' => self.cmd("goto_prev_match", .{}),
'B' => self.cmd("enter_move_to_char_mode", command.fmt(.{false})),
'T' => self.cmd("enter_move_to_char_mode", command.fmt(.{true})),
'B' => self.cmd("move_to_char", command.fmt(.{false})),
'T' => self.cmd("move_to_char", command.fmt(.{true})),
'X' => self.cmd("cut", .{}),
'C' => self.cmd("copy", .{}),
'V' => self.cmd("system_paste", .{}),
'K' => self.leader = .{ .keypress = keynormal, .modifiers = modifiers },
'F' => self.cmd("enter_find_mode", .{}),
'G' => self.cmd("enter_goto_mode", .{}),
'F' => self.cmd("find", .{}),
'G' => self.cmd("goto", .{}),
'A' => self.cmd("select_all", .{}),
'/' => self.cmd("toggle_comment", .{}),
key.ENTER => self.cmd("smart_insert_line_after", .{}),
@ -136,7 +136,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'Z' => self.cmd("redo", .{}),
'Q' => self.cmd("quit_without_saving", .{}),
'W' => self.cmd("close_file_without_saving", .{}),
'F' => self.cmd("enter_find_in_files_mode", .{}),
'F' => self.cmd("find_in_files", .{}),
'L' => self.cmd_async("add_cursor_all_matches"),
'I' => self.cmd_async("toggle_inspector_view"),
key.ENTER => self.cmd("smart_insert_line_before", .{}),
@ -235,7 +235,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'a' => self.seq(.{ "move_right", "enter_mode" }, command.fmt(.{"vim/insert"})),
'v' => self.cmd("enter_mode", command.fmt(.{"vim/visual"})),
'/' => self.cmd("enter_find_mode", .{}),
'/' => self.cmd("find", .{}),
'n' => self.cmd("goto_next_match", .{}),
'h' => self.cmd_count("move_left_vim", .{}),
@ -515,11 +515,11 @@ const hints = tui.KeybindHints.initComptime(.{
.{ "dupe_up", "S-A-d" },
.{ "enable_fast_scroll", "hold Ctrl" },
.{ "enable_jump_mode", "hold Alt" },
.{ "enter_find_in_files_mode", "C-S-f" },
.{ "enter_find_mode", "C-f, /" },
.{ "enter_goto_mode", "C-g" },
.{ "enter_move_to_char_mode", "C-b, C-t" }, // true/false
.{ "enter_open_file_mode", "C-o" },
.{ "find_in_files", "C-S-f" },
.{ "find", "C-f, /" },
.{ "goto", "C-g" },
.{ "move_to_char", "C-b, C-t" }, // true/false
.{ "open_file", "C-o" },
.{ "filter", "A-s" }, // self.cmd("filter", command.fmt(.{"sort"})),
// .{ "filter", "S-A-s" }, // self.cmd("filter", command.fmt(.{ "sort", "-u" })),
.{ "format", "S-A-f" },

View file

@ -104,14 +104,14 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'L' => self.cmd_cycle3("scroll_view_center", "scroll_view_top", "scroll_view_bottom", .{}),
'N' => self.cmd("goto_next_match", .{}),
'P' => self.cmd("goto_prev_match", .{}),
'B' => self.cmd("enter_move_to_char_mode", command.fmt(.{false})),
'T' => self.cmd("enter_move_to_char_mode", command.fmt(.{true})),
'B' => self.cmd("move_to_char", command.fmt(.{false})),
'T' => self.cmd("move_to_char", command.fmt(.{true})),
'X' => self.cmd("cut", .{}),
'C' => self.cmd("copy", .{}),
'V' => self.cmd("system_paste", .{}),
'K' => self.leader = .{ .keypress = keynormal, .modifiers = modifiers },
'F' => self.cmd("enter_find_mode", .{}),
'G' => self.cmd("enter_goto_mode", .{}),
'F' => self.cmd("find", .{}),
'G' => self.cmd("goto", .{}),
'A' => self.cmd("select_all", .{}),
'/' => self.cmd("toggle_comment", .{}),
key.ENTER => self.cmd("smart_insert_line_after", .{}),
@ -136,7 +136,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'Z' => self.cmd("redo", .{}),
'Q' => self.cmd("quit_without_saving", .{}),
'W' => self.cmd("close_file_without_saving", .{}),
'F' => self.cmd("enter_find_in_files_mode", .{}),
'F' => self.cmd("find_in_files", .{}),
'L' => self.cmd_async("add_cursor_all_matches"),
'I' => self.cmd_async("toggle_inspector_view"),
key.ENTER => self.cmd("smart_insert_line_before", .{}),
@ -233,7 +233,7 @@ fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) !void {
'a' => self.seq(.{ "move_right", "enter_mode" }, command.fmt(.{"vim/insert"})),
'v' => self.cmd("enter_mode", command.fmt(.{"vim/visual"})),
'/' => self.cmd("enter_find_mode", .{}),
'/' => self.cmd("find", .{}),
'n' => self.cmd("goto_next_match", .{}),
'h' => self.cmd_count("select_left", .{}),
@ -475,11 +475,11 @@ const hints = tui.KeybindHints.initComptime(.{
.{ "dupe_up", "S-A-d" },
.{ "enable_fast_scroll", "hold Ctrl" },
.{ "enable_jump_mode", "hold Alt" },
.{ "enter_find_in_files_mode", "C-S-f" },
.{ "enter_find_mode", "C-f, /" },
.{ "enter_goto_mode", "C-g" },
.{ "enter_move_to_char_mode", "C-b, C-t" }, // true/false
.{ "enter_open_file_mode", "C-o" },
.{ "find_in_files", "C-S-f" },
.{ "find", "C-f, /" },
.{ "goto", "C-g" },
.{ "move_to_char", "C-b, C-t" }, // true/false
.{ "open_file", "C-o" },
.{ "filter", "A-s" }, // self.cmd("filter", command.fmt(.{"sort"})),
// .{ "filter", "S-A-s" }, // self.cmd("filter", command.fmt(.{ "sort", "-u" })),
.{ "format", "S-A-f" },