diff --git a/src/keybind/builtin/emacs.json b/src/keybind/builtin/emacs.json index b7349ec..cd47455 100644 --- a/src/keybind/builtin/emacs.json +++ b/src/keybind/builtin/emacs.json @@ -1,22 +1,12 @@ { "project": { "press": [ - ["f4", "toggle_input_mode"], ["ctrl+0", "reset_fontsize"], ["ctrl+=", "adjust_fontsize", 1.0], - ["ctrl+-", "adjust_fontsize", -1.0], - ["ctrl+r", "find_file"], - ["ctrl+h ctrl+a", "open_help"], - ["ctrl+x ctrl+f", "open_file"], - ["ctrl+x b", "open_recent"], - ["ctrl+c ctrl+o", "open_recent_project"], - ["ctrl+c g", "find_in_files"], - ["alt+x", "open_command_palette"], - ["ctrl+x ctrl+c", "quit"] + ["ctrl+-", "adjust_fontsize", -1.0] ] }, "normal": { - "inherit": "project", "press": [ ["ctrl+g", "cancel"], ["ctrl+_", "undo"], @@ -42,9 +32,12 @@ ["ctrl+y", "system_paste"], ["ctrl+x ctrl+f", "open_file"], ["ctrl+x k", "close_file"], + ["ctrl+x ctrl+c", "quit"], ["ctrl+x ctrl+s", "save_file"], + ["ctrl+x ctrl+c", "quit"], ["ctrl+x b", "switch_buffers"], ["ctrl+x ctrl+r", "open_recent"], + ["alt+x", "open_command_palette"], ["ctrl+space", "enter_mode", "select"], ["ctrl+c l = =", "format"], @@ -102,9 +95,13 @@ }, "home": { "on_match_failure": "ignore", - "inherit": "project", "press": [ - ["f", "change_fontface"] + ["ctrl+h ctrl+a", "open_help"], + ["ctrl+x ctrl+f", "open_file"], + ["ctrl+x b", "open_recent"], + ["alt+x", "open_command_palette"], + ["f", "change_fontface"], + ["ctrl+x ctrl+c", "quit"] ] } } diff --git a/src/keybind/builtin/flow.json b/src/keybind/builtin/flow.json index 54972fe..35cdc55 100644 --- a/src/keybind/builtin/flow.json +++ b/src/keybind/builtin/flow.json @@ -1,33 +1,7 @@ { "project": { "press": [ - ["ctrl+e", "find_file"], ["ctrl+shift+n", "create_new_file"], - ["ctrl+r", "open_recent_project"], - ["f1", "open_help"], - ["ctrl+j", "toggle_panel"], - ["ctrl+q", "quit"], - ["ctrl+w", "quit"], - ["ctrl+o", "open_file"], - ["ctrl+e", "open_recent"], - ["ctrl+p", "open_command_palette"], - ["ctrl+k ctrl+t", "change_theme"], - ["ctrl+shift+p", "open_command_palette"], - ["ctrl+shift+q", "quit_without_saving"], - ["ctrl+shift+f", "find_in_files"], - ["ctrl+shift+l", "toggle_panel"], - ["alt+shift+p", "open_command_palette"], - ["alt+n", "goto_next_file_or_diagnostic"], - ["alt+p", "goto_prev_file_or_diagnostic"], - ["alt+l", "toggle_panel"], - ["alt+i", "toggle_inputview"], - ["alt+x", "open_command_palette"], - ["f4", "toggle_input_mode"], - ["ctrl+f2", "insert_command_name"], - ["f9", "theme_prev"], - ["f10", "theme_next"], - ["f11", "toggle_panel"], - ["f12", "toggle_inputview"], ["alt+!", "select_task"], ["ctrl+tab", "next_tab"], ["ctrl+shift+tab", "previous_tab"], @@ -37,15 +11,19 @@ ["ctrl+minus", "adjust_fontsize", -1.0], ["f5", ["create_scratch_buffer", "*test*"], ["shell_execute_insert", "zig", "build", "test"]], ["f7", ["create_scratch_buffer", "*build*"], ["shell_execute_insert", "zig", "build"]], - ["ctrl+f6", "open_version_info"], ["alt+d", ["shell_execute_log", "date"]] ] }, "normal": { "inherit": "project", "press": [ + ["ctrl+e", "open_recent"], + ["ctrl+r", "open_recent_project"], + ["ctrl+j", "toggle_panel"], ["ctrl+z", "undo"], ["ctrl+y", "redo"], + ["ctrl+q", "quit"], + ["ctrl+o", "open_file"], ["ctrl+w", "close_file"], ["ctrl+s", "save_file"], ["ctrl+l", "scroll_view_center_cycle"], @@ -61,6 +39,7 @@ ["ctrl+k ctrl+u", "delete_to_begin"], ["ctrl+k ctrl+k", "delete_to_end"], ["ctrl+k ctrl+d", "move_cursor_next_match"], + ["ctrl+k ctrl+t", "change_theme"], ["ctrl+k ctrl+i", "hover"], ["ctrl+f", "find"], ["ctrl+g", "goto"], @@ -83,9 +62,12 @@ ["ctrl+f10", "toggle_whitespace_mode"], ["ctrl+f12", "goto_implementation"], ["ctrl+shift+s", "save_as"], + ["ctrl+shift+p", "open_command_palette"], ["ctrl+shift+d", "dupe_down"], ["ctrl+shift+z", "redo"], + ["ctrl+shift+q", "quit_without_saving"], ["ctrl+shift+w", "close_file_without_saving"], + ["ctrl+shift+f", "find_in_files"], ["ctrl+shift+l", "run_async", "add_cursor_all_matches"], ["ctrl+shift+i", "run_async", "toggle_inspector_view"], ["ctrl+shift+m", "show_diagnostics"], @@ -104,10 +86,12 @@ ["alt+u", "to_upper"], ["alt+l", "to_lower"], ["alt+c", "switch_case"], + ["alt+i", "toggle_inputview"], ["alt+b", "move_word_left"], ["alt+f", "move_word_right"], ["alt+s", "filter", "sort"], ["alt+v", "paste"], + ["alt+x", "open_command_palette"], ["alt+R", ["shell_execute_insert", "openssl", "rand", "-hex", "4"]], ["alt+left", "jump_back"], ["alt+right", "jump_forward"], @@ -117,6 +101,7 @@ ["alt+f10", "gutter_mode_next"], ["alt+shift+f10", "gutter_style_next"], ["alt+f12", "goto_declaration"], + ["alt+shift+p", "open_command_palette"], ["alt+shift+d", "dupe_up"], ["alt+shift+f", "format"], ["alt+shift+s", "filter", "sort", "-u"], @@ -149,6 +134,8 @@ ["shift+backspace", "delete_backward"], ["shift+tab", "unindent"], ["f2", "rename_symbol"], + ["f4", "toggle_input_mode"], + ["ctrl+f2", "insert_command_name"], ["f3", "goto_next_match"], ["f15", "goto_prev_match"], ["ctrl+f5", "dump_current_line_tree"], @@ -234,13 +221,46 @@ "inherit": "project", "on_match_failure": "ignore", "press": [ + ["h", "open_help"], + ["o", "open_file"], + ["e", "open_recent"], + ["r", "open_recent_project"], + ["p", "open_command_palette"], ["c", "open_config"], ["g", "open_gui_config"], ["k", "open_keybind_config"], + ["t", "change_theme"], ["f", "change_fontface"], + ["v", "open_version_info"], + ["q", "quit"], ["ctrl+f ctrl+f ctrl+f ctrl+f ctrl+f", "home_sheeran"], + ["ctrl+j", "toggle_panel"], + ["ctrl+q", "quit"], + ["ctrl+w", "quit"], + ["ctrl+o", "open_file"], + ["ctrl+e", "open_recent"], + ["ctrl+r", "open_recent_project"], + ["ctrl+p", "open_command_palette"], + ["ctrl+k ctrl+t", "change_theme"], + ["ctrl+shift+p", "open_command_palette"], + ["ctrl+shift+q", "quit_without_saving"], ["ctrl+shift+r", "restart"], + ["ctrl+shift+f", "find_in_files"], + ["ctrl+shift+l", "toggle_panel"], + ["alt+shift+p", "open_command_palette"], + ["alt+n", "goto_next_file_or_diagnostic"], + ["alt+p", "goto_prev_file_or_diagnostic"], + ["alt+l", "toggle_panel"], + ["alt+i", "toggle_inputview"], + ["alt+x", "open_command_palette"], + ["f1", "open_help"], + ["f4", "toggle_input_mode"], + ["ctrl+f2", "insert_command_name"], ["f6", "open_config"], + ["f9", "theme_prev"], + ["f10", "theme_next"], + ["f11", "toggle_panel"], + ["f12", "toggle_inputview"], ["up", "home_menu_up"], ["down", "home_menu_down"], ["enter", "home_menu_activate"] diff --git a/src/keybind/builtin/helix.json b/src/keybind/builtin/helix.json index 2035724..d17fb85 100644 --- a/src/keybind/builtin/helix.json +++ b/src/keybind/builtin/helix.json @@ -511,16 +511,13 @@ "home": { "on_match_failure": "ignore", "press": [ - ["f", "find_file"], - ["g", "find_in_files"], [":", "open_command_palette"], + [";", "open_command_palette"], + ["shift+;", "open_command_palette"], ["b", "open_keybind_config"], ["j", "home_menu_down"], ["k", "home_menu_up"], - ["F", "change_fontface"], - ["h", "open_help"], - ["v", "open_version_info"], - ["q", "quit"], + ["f", "change_fontface"], ["space", "home_menu_activate"] ] } diff --git a/src/keybind/builtin/vim.json b/src/keybind/builtin/vim.json index 87438f8..12ad456 100644 --- a/src/keybind/builtin/vim.json +++ b/src/keybind/builtin/vim.json @@ -193,16 +193,11 @@ "syntax": "vim", "on_match_failure": "ignore", "press": [ - ["f", "find_file"], - ["g", "find_in_files"], [":", "open_command_palette"], ["b", "open_keybind_config"], ["j", "home_menu_down"], ["k", "home_menu_up"], - ["F", "change_fontface"], - ["h", "open_help"], - ["v", "open_version_info"], - ["q", "quit"], + ["f", "change_fontface"], ["", "home_menu_activate"] ] } diff --git a/src/tui/home.zig b/src/tui/home.zig index ed5bd84..afa6b3a 100644 --- a/src/tui/home.zig +++ b/src/tui/home.zig @@ -27,37 +27,29 @@ input_namespace: []const u8, const Self = @This(); const menu_commands = if (build_options.gui) &[_][]const u8{ - "find_file", - "create_new_file", + "open_help", "open_file", + "open_recent", "open_recent_project", - "find_in_files", "open_command_palette", - "select_task", - "add_task", "open_config", "open_gui_config", - "change_fontface", "open_keybind_config", "toggle_input_mode", "change_theme", - "open_help", + "change_fontface", "open_version_info", "quit", } else &[_][]const u8{ - "find_file", - "create_new_file", + "open_help", "open_file", + "open_recent", "open_recent_project", - "find_in_files", "open_command_palette", - "select_task", - "add_task", "open_config", "open_keybind_config", "toggle_input_mode", "change_theme", - "open_help", "open_version_info", "quit", }; diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index eb0e0f7..f0a2083 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -240,7 +240,7 @@ const cmds = struct { try self.check_all_not_dirty(); try tp.self_pid().send("quit"); } - pub const quit_meta = .{ .description = "Quit" }; + pub const quit_meta = .{ .description = "Quit (exit) Flow Control" }; pub fn quit_without_saving(_: *Self, _: Ctx) Result { try tp.self_pid().send("quit"); @@ -399,19 +399,19 @@ const cmds = struct { try command.executeName("open_scratch_buffer", command.fmt(.{ "version", root.version_info, "diff" })); tui.need_render(); } - pub const open_version_info_meta = .{ .description = "Version" }; + pub const open_version_info_meta = .{ .description = "Show build version information" }; pub fn open_config(_: *Self, _: Ctx) Result { const file_name = try root.get_config_file_name(@import("config")); try tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_name[0 .. file_name.len - 5] } }); } - pub const open_config_meta = .{ .description = "Edit configuration" }; + pub const open_config_meta = .{ .description = "Edit configuration file" }; pub fn open_gui_config(_: *Self, _: Ctx) Result { const file_name = try root.get_config_file_name(@import("gui_config")); try tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_name[0 .. file_name.len - ".json".len] } }); } - pub const open_gui_config_meta = .{ .description = "Edit gui configuration" }; + pub const open_gui_config_meta = .{ .description = "Edit gui configuration file" }; pub fn open_tabs_style_config(self: *Self, _: Ctx) Result { const Style = @import("status/tabs.zig").Style; @@ -433,7 +433,7 @@ const cmds = struct { })); if (self.get_active_buffer()) |buffer| buffer.mark_not_ephemeral(); } - pub const open_tabs_style_config_meta: Meta = .{ .description = "Edit tab style" }; + pub const open_tabs_style_config_meta = .{ .description = "Edit tab styles configuration file" }; pub fn create_scratch_buffer(self: *Self, ctx: Ctx) Result { const args = try ctx.args.clone(self.allocator); @@ -463,7 +463,7 @@ const cmds = struct { if (tp.env.get().str("language").len == 0) try command.executeName("change_file_type", .{}); } - pub const create_new_file_meta: Meta = .{ .description = "New file" }; + pub const create_new_file_meta = .{ .description = "Create: New File…" }; pub fn delete_buffer(self: *Self, ctx: Ctx) Result { var file_path: []const u8 = undefined; diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 19fc5de..a0cce39 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -676,12 +676,11 @@ const cmds = struct { pub const Target = Self; const Ctx = command.Context; const Result = command.Result; - const Meta = command.Metadata; pub fn restart(_: *Self, _: Ctx) Result { try tp.self_pid().send("restart"); } - pub const restart_meta: Meta = .{ .description = "Restart (without saving)" }; + pub const restart_meta = .{ .description = "Restart flow (without saving)" }; pub fn force_terminate(self: *Self, _: Ctx) Result { self.deinit(); @@ -712,7 +711,7 @@ const cmds = struct { self.logger.print("theme: {s}", .{self.theme.description}); try save_config(); } - pub const theme_next_meta: Meta = .{ .description = "Next color theme" }; + pub const theme_next_meta = .{ .description = "Switch to next color theme" }; pub fn theme_prev(self: *Self, _: Ctx) Result { self.theme = get_prev_theme_by_name(self.theme.name); @@ -721,7 +720,7 @@ const cmds = struct { self.logger.print("theme: {s}", .{self.theme.description}); try save_config(); } - pub const theme_prev_meta: Meta = .{ .description = "Previous color theme" }; + pub const theme_prev_meta = .{ .description = "Switch to previous color theme" }; pub fn toggle_whitespace_mode(self: *Self, _: Ctx) Result { self.config.whitespace_mode = if (std.mem.eql(u8, self.config.whitespace_mode, "none")) @@ -744,7 +743,7 @@ const cmds = struct { _ = try self.send_widgets(tp.self_pid(), m); self.logger.print("whitespace rendering {s}", .{self.config.whitespace_mode}); } - pub const toggle_whitespace_mode_meta: Meta = .{ .description = "Next whitespace mode" }; + pub const toggle_whitespace_mode_meta = .{ .description = "Switch to next whitespace rendering mode" }; pub fn toggle_input_mode(self: *Self, _: Ctx) Result { var it = std.mem.splitScalar(u8, self.config.input_mode, '/'); @@ -767,7 +766,7 @@ const cmds = struct { try keybind.set_namespace(self.config.input_mode); return self.refresh_input_mode(); } - pub const toggle_input_mode_meta: Meta = .{ .description = "Switch input mode" }; + pub const toggle_input_mode_meta = .{ .description = "Switch to next input mode" }; pub fn enter_mode(self: *Self, ctx: Ctx) Result { var mode: []const u8 = undefined; @@ -796,27 +795,22 @@ const cmds = struct { pub fn open_command_palette(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/command_palette.zig").Type); } - pub const open_command_palette_meta: Meta = .{ .description = "Command palette" }; + pub const open_command_palette_meta = .{ .description = "Show/Run commands" }; pub fn insert_command_name(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/list_all_commands_palette.zig").Type); } - pub const insert_command_name_meta: Meta = .{ .description = "Show active keybindings" }; - - pub fn find_file(self: *Self, _: Ctx) Result { - return self.enter_overlay_mode(@import("mode/overlay/open_recent.zig")); - } - pub const find_file_meta: Meta = .{ .description = "Find file" }; + pub const insert_command_name_meta = .{ .description = "Insert command name" }; pub fn open_recent(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/open_recent.zig")); } - pub const open_recent_meta: Meta = .{ .description = "Open recent" }; + pub const open_recent_meta = .{ .description = "Open recent file" }; pub fn open_recent_project(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/open_recent_project.zig").Type); } - pub const open_recent_project_meta: Meta = .{ .description = "Open project" }; + pub const open_recent_project_meta = .{ .description = "Open recent project" }; pub fn switch_buffers(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/buffer_palette.zig").Type); @@ -826,7 +820,7 @@ const cmds = struct { pub fn select_task(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/task_palette.zig").Type); } - pub const select_task_meta: Meta = .{ .description = "Run task" }; + pub const select_task_meta = .{ .description = "Select a task to run" }; pub fn add_task(self: *Self, ctx: Ctx) Result { return enter_mini_mode(self, struct { @@ -846,7 +840,7 @@ const cmds = struct { } }, ctx); } - pub const add_task_meta: Meta = .{ .description = "Add task" }; + pub const add_task_meta = .{ .description = "Add a task to run" }; pub fn delete_task(_: *Self, ctx: Ctx) Result { var task: []const u8 = undefined; @@ -859,7 +853,7 @@ const cmds = struct { pub fn change_theme(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/theme_palette.zig").Type); } - pub const change_theme_meta: Meta = .{ .description = "Change color theme" }; + pub const change_theme_meta = .{ .description = "Select color theme" }; pub fn change_file_type(self: *Self, _: Ctx) Result { return self.enter_overlay_mode(@import("mode/overlay/file_type_palette.zig").Type); @@ -870,7 +864,7 @@ const cmds = struct { if (build_options.gui) self.rdr.get_fontfaces(); } - pub const change_fontface_meta: Meta = .{ .description = "Change font" }; + pub const change_fontface_meta = .{ .description = "Select font face" }; pub fn exit_overlay_mode(self: *Self, _: Ctx) Result { self.rdr.cursor_disable(); @@ -885,12 +879,12 @@ const cmds = struct { pub fn find(self: *Self, ctx: Ctx) Result { return enter_mini_mode(self, @import("mode/mini/find.zig"), ctx); } - pub const find_meta: Meta = .{ .description = "Find" }; + pub const find_meta = .{ .description = "Find in current file" }; pub fn find_in_files(self: *Self, ctx: Ctx) Result { return enter_mini_mode(self, @import("mode/mini/find_in_files.zig"), ctx); } - pub const find_in_files_meta: Meta = .{ .description = "Find in files" }; + pub const find_in_files_meta = .{ .description = "Find in all project files" }; pub fn goto(self: *Self, ctx: Ctx) Result { return enter_mini_mode(self, @import("mode/mini/goto.zig"), ctx); @@ -900,7 +894,7 @@ const cmds = struct { pub fn move_to_char(self: *Self, ctx: Ctx) Result { return enter_mini_mode(self, @import("mode/mini/move_to_char.zig"), ctx); } - pub const move_to_char_meta: Meta = .{ .description = "Move to character" }; + pub const move_to_char_meta = .{ .description = "Move cursor to matching character" }; pub fn open_file(self: *Self, ctx: Ctx) Result { if (get_active_selection(self.allocator)) |text| {