feat: add flow normal and palette mode keybindings
This commit is contained in:
parent
e6d2dca5c1
commit
7351cb7d7c
2 changed files with 238 additions and 46 deletions
|
@ -17,7 +17,7 @@ const KeyEvent = @import("KeyEvent.zig");
|
||||||
pub const mode = struct {
|
pub const mode = struct {
|
||||||
pub const input = struct {
|
pub const input = struct {
|
||||||
pub const flow = Handler("flow", "normal");
|
pub const flow = Handler("flow", "normal");
|
||||||
pub const home = Handler("home", "normal");
|
pub const home = Handler("flow", "home");
|
||||||
pub const vim = struct {
|
pub const vim = struct {
|
||||||
pub const normal = Handler("vim", "normal");
|
pub const normal = Handler("vim", "normal");
|
||||||
pub const insert = Handler("vim", "insert");
|
pub const insert = Handler("vim", "insert");
|
||||||
|
@ -30,7 +30,7 @@ pub const mode = struct {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
pub const overlay = struct {
|
pub const overlay = struct {
|
||||||
pub const palette = Handler("overlay", "palette");
|
pub const palette = Handler("flow", "palette");
|
||||||
};
|
};
|
||||||
pub const mini = struct {
|
pub const mini = struct {
|
||||||
pub const goto = Handler("mini", "goto");
|
pub const goto = Handler("mini", "goto");
|
||||||
|
|
|
@ -1,4 +1,240 @@
|
||||||
{
|
{
|
||||||
|
"flow": {
|
||||||
|
"normal": {
|
||||||
|
"on_match_failure": "insert",
|
||||||
|
"bindings": [
|
||||||
|
["<C-e>", "open_recent"],
|
||||||
|
["<C-r>", "open_recent_project"],
|
||||||
|
["<C-j>", "toggle_panel"],
|
||||||
|
["<C-z>", "undo"],
|
||||||
|
["<C-y>", "redo"],
|
||||||
|
["<C-q>", "quit"],
|
||||||
|
["<C-o>", "open_file"],
|
||||||
|
["<C-w>", "close_file"],
|
||||||
|
["<C-s>", "save_file"],
|
||||||
|
["<C-l>", "cmd_cycle3", "scroll_view_center", "scroll_view_top", "scroll_view_bottom"],
|
||||||
|
["<C-n>", "goto_next_match"],
|
||||||
|
["<C-p>", "goto_prev_match"],
|
||||||
|
["<C-b>", "move_to_char", "false"],
|
||||||
|
["<C-t>", "move_to_char", "true"],
|
||||||
|
["<C-x>", "cut"],
|
||||||
|
["<C-c>", "copy"],
|
||||||
|
["<C-v>", "system_paste"],
|
||||||
|
["<C-u>", "pop_cursor"],
|
||||||
|
["<C-k><C-u>", "delete_to_begin"],
|
||||||
|
["<C-k><C-k>", "delete_to_end"],
|
||||||
|
["<C-k><C-d>", "move_cursor_next_match"],
|
||||||
|
["<C-k><C-t>", "change_theme"],
|
||||||
|
["<C-k><C-i>", "hover"],
|
||||||
|
["<C-f>", "find"],
|
||||||
|
["<C-g>", "goto"],
|
||||||
|
["<C-d>", "add_cursor_next_match"],
|
||||||
|
["<C-a>", "select_all"],
|
||||||
|
["<C-i>", "insert_bytes", "\t"],
|
||||||
|
["<C-/>", "toggle_comment"],
|
||||||
|
["<C-CR>", "smart_insert_line_after"],
|
||||||
|
["<C-Space>", "completion"],
|
||||||
|
["<C-End>", "move_buffer_end"],
|
||||||
|
["<C-Home>", "move_buffer_begin"],
|
||||||
|
["<C-Up>", "move_scroll_up"],
|
||||||
|
["<C-Down>", "move_scroll_down"],
|
||||||
|
["<C-PageUp>", "move_scroll_page_up"],
|
||||||
|
["<C-PageDown>", "move_scroll_page_down"],
|
||||||
|
["<C-Left>", "move_word_left"],
|
||||||
|
["<C-Right>", "move_word_right"],
|
||||||
|
["<C-Backspace>", "delete_word_left"],
|
||||||
|
["<C-Delete>", "delete_word_right"],
|
||||||
|
["<C-F5>", "toggle_inspector_view"],
|
||||||
|
["<C-F10>", "toggle_whitespace_mode"],
|
||||||
|
["<C-F12>", "goto_implementation"],
|
||||||
|
|
||||||
|
["<C-S-s>", "save_as"],
|
||||||
|
["<C-S-p>", "open_command_palette"],
|
||||||
|
["<C-S-d>", "dupe_down"],
|
||||||
|
["<C-S-z>", "redo"],
|
||||||
|
["<C-S-q>", "quit_without_saving"],
|
||||||
|
["<C-S-w>", "close_file_without_saving"],
|
||||||
|
["<C-S-f>", "find_in_files"],
|
||||||
|
["<C-S-l>", "add_cursor_all_matches_async"],
|
||||||
|
["<C-S-i>", "toggle_inspector_view_async"],
|
||||||
|
["<C-S-m>", "show_diagnostics"],
|
||||||
|
["<C-S-Ce>", "smart_insert_line_before"],
|
||||||
|
["<C-S-End>", "select_buffer_end"],
|
||||||
|
["<C-S-Home>", "select_buffer_begin"],
|
||||||
|
["<C-S-Up>", "select_scroll_up"],
|
||||||
|
["<C-S-Down>", "select_scroll_down"],
|
||||||
|
["<C-S-Left>", "select_word_left"],
|
||||||
|
["<C-S-Right>", "select_word_right"],
|
||||||
|
["<C-S-Space>", "selections_reverse"],
|
||||||
|
|
||||||
|
["<A-o>", "open_previous_file"],
|
||||||
|
["<A-j>", "join_next_line"],
|
||||||
|
["<A-n>", "goto_next_file_or_diagnostic"],
|
||||||
|
["<A-p>", "goto_prev_file_or_diagnostic"],
|
||||||
|
["<A-u>", "to_upper"],
|
||||||
|
["<A-l>", "to_lower"],
|
||||||
|
["<A-c>", "switch_case"],
|
||||||
|
["<A-i>", "toggle_inputview"],
|
||||||
|
["<A-b>", "move_word_left"],
|
||||||
|
["<A-f>", "move_word_right"],
|
||||||
|
["<A-s>", "filter", "sort"],
|
||||||
|
["<A-v>", "paste"],
|
||||||
|
["<A-x>", "open_command_palette"],
|
||||||
|
["<A-Left>", "jump_back"],
|
||||||
|
["<A-Right>", "jump_forward"],
|
||||||
|
["<A-Up>", "pull_up"],
|
||||||
|
["<A-Down>", "pull_down"],
|
||||||
|
["<A-CR>", "insert_line"],
|
||||||
|
["<A-F10>", "gutter_mode_next"],
|
||||||
|
["<A-F12>", "goto_declaration"],
|
||||||
|
|
||||||
|
["<A-S-p>", "open_command_palette"],
|
||||||
|
["<A-S-d>", "dupe_up"],
|
||||||
|
["<A-S-f>", "format"],
|
||||||
|
["<A-S-s>", "filter", "sort", "-u"],
|
||||||
|
["<A-S-v>", "paste"],
|
||||||
|
["<A-S-i>", "add_cursors_to_line_ends"],
|
||||||
|
["<A-S-Left>", "shrink_selection"],
|
||||||
|
["<A-S-Right>", "expand_selection"],
|
||||||
|
["<A-S-Home>", "move_scroll_left"],
|
||||||
|
["<A-S-End>", "move_scroll_right"],
|
||||||
|
["<A-S-Up>", "add_cursor_up"],
|
||||||
|
["<A-S-Down>", "add_cursor_down"],
|
||||||
|
["<A-S-F12>", "goto_type_definition"],
|
||||||
|
|
||||||
|
["<S-F3>", "goto_prev_match"],
|
||||||
|
["<S-F10>", "toggle_syntax_highlighting"],
|
||||||
|
["<S-F12>", "references"],
|
||||||
|
["<S-Left>", "select_left"],
|
||||||
|
["<S-Right>", "select_right"],
|
||||||
|
["<S-Up>", "select_up"],
|
||||||
|
["<S-Down>", "select_down"],
|
||||||
|
["<S-Home>", "smart_select_begin"],
|
||||||
|
["<S-End>", "select_end"],
|
||||||
|
["<S-PageUp>", "select_page_up"],
|
||||||
|
["<S-PageDown>", "select_page_down"],
|
||||||
|
["<S-CR>", "smart_insert_line_before"],
|
||||||
|
["<S-Backspace>", "delete_backward"],
|
||||||
|
["<S-Tab>", "unindent"],
|
||||||
|
|
||||||
|
["<F2>", "toggle_input_mode"],
|
||||||
|
["<F3>", "goto_next_match"],
|
||||||
|
["<F15>", "goto_prev_match"],
|
||||||
|
["<F5>", "toggle_inspector_view"],
|
||||||
|
["<F6>", "dump_current_line_tree"],
|
||||||
|
["<F7>", "dump_current_line"],
|
||||||
|
["<F9>", "theme_prev"],
|
||||||
|
["<F10>", "theme_next"],
|
||||||
|
["<F11>", "toggle_panel"],
|
||||||
|
["<F12>", "goto_definition"],
|
||||||
|
["<F34>", "toggle_whitespace_mode"],
|
||||||
|
["<Esc>", "cancel"],
|
||||||
|
["<CR>", "smart_insert_line"],
|
||||||
|
["<Delete>", "delete_forward"],
|
||||||
|
["<Backspace>", "delete_backward"],
|
||||||
|
["<Left>", "move_left"],
|
||||||
|
["<Right>", "move_right"],
|
||||||
|
["<Up>", "move_up"],
|
||||||
|
["<Down>", "move_down"],
|
||||||
|
["<Home>", "smart_move_begin"],
|
||||||
|
["<End>", "move_end"],
|
||||||
|
["<PageUp>", "move_page_up"],
|
||||||
|
["<PageDown>", "move_page_down"],
|
||||||
|
["<Tab>", "indent"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"home": {
|
||||||
|
"on_match_failure": "ignore",
|
||||||
|
"bindings": [
|
||||||
|
["<C-f><C-f><C-f><C-f><C-f>", "home_sheeran"],
|
||||||
|
["<C-j>", "toggle_panel"],
|
||||||
|
["<C-q>", "quit"],
|
||||||
|
["<C-w>", "quit"],
|
||||||
|
["<C-o>", "open_file"],
|
||||||
|
["<C-e>", "open_recent"],
|
||||||
|
["<C-r>", "open_recent_project"],
|
||||||
|
["<C-p>", "open_command_palette"],
|
||||||
|
["<C-k><C-t>", "change_theme"],
|
||||||
|
["<C-S-p>", "open_command_palette"],
|
||||||
|
["<C-S-q>", "quit_without_saving"],
|
||||||
|
["<C-S-r>", "restart"],
|
||||||
|
["<C-S-f>", "find_in_files"],
|
||||||
|
["<C-S-l>", "toggle_panel"],
|
||||||
|
["<A-S-p>", "open_command_palette"],
|
||||||
|
["<A-n>", "goto_next_file_or_diagnostic"],
|
||||||
|
["<A-p>", "goto_prev_file_or_diagnostic"],
|
||||||
|
["<A-l>", "toggle_panel"],
|
||||||
|
["<A-i>", "toggle_inputview"],
|
||||||
|
["<A-x>", "open_command_palette"],
|
||||||
|
["h", "open_help"],
|
||||||
|
["o", "open_file"],
|
||||||
|
["e", "open_recent"],
|
||||||
|
["r", "open_recent_project"],
|
||||||
|
["p", "open_command_palette"],
|
||||||
|
["c", "open_config"],
|
||||||
|
["t", "change_theme"],
|
||||||
|
["q", "quit"],
|
||||||
|
["<F1>", "open_help"],
|
||||||
|
["<F6>", "open_config"],
|
||||||
|
["<F9>", "theme_prev"],
|
||||||
|
["<F10>", "theme_next"],
|
||||||
|
["<F11>", "toggle_panel"],
|
||||||
|
["<F12>", "toggle_inputview"],
|
||||||
|
["<Up>", "home_menu_up"],
|
||||||
|
["<Down>", "home_menu_down"],
|
||||||
|
["<CR>", "home_menu_activate"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"palette": {
|
||||||
|
"on_match_failure": "insert",
|
||||||
|
"bindings": [
|
||||||
|
["<C-j>", "toggle_panel"],
|
||||||
|
["<C-q>", "quit"],
|
||||||
|
["<C-w>", "close_file"],
|
||||||
|
["<C-p>", "palette_menu_up"],
|
||||||
|
["<C-n>", "palette_menu_down"],
|
||||||
|
["<C-e>", "palette_menu_down"],
|
||||||
|
["<C-r>", "palette_menu_down"],
|
||||||
|
["<C-t>", "palette_menu_down"],
|
||||||
|
["<C-v>", "system_paste"],
|
||||||
|
["<C-c>", "palette_menu_cancel"],
|
||||||
|
["<C-g>", "palette_menu_cancel"],
|
||||||
|
["<C-Esc>", "palette_menu_cancel"],
|
||||||
|
["<C-Up>", "palette_menu_up"],
|
||||||
|
["<C-Down>", "palette_menu_down"],
|
||||||
|
["<C-PageUp>", "palette_menu_pageup"],
|
||||||
|
["<C-PageDown>", "palette_menu_pagedown"],
|
||||||
|
["<C-CR>", "palette_menu_activate"],
|
||||||
|
["<C-Backspace>", "overlay_delete_word_left"],
|
||||||
|
|
||||||
|
["<C-S-e>", "palette_menu_up"],
|
||||||
|
["<C-S-r>", "palette_menu_up"],
|
||||||
|
["<C-S-p>", "palette_menu_down"],
|
||||||
|
["<C-S-q>", "quit_without_saving"],
|
||||||
|
["<C-S-w>", "close_file_without_saving"],
|
||||||
|
["<C-S-l>", "overlay_toggle_panel"],
|
||||||
|
["<C-S-i>", "overlay_toggle_inputview"],
|
||||||
|
|
||||||
|
["<A-S-p>", "palette_menu_down"],
|
||||||
|
|
||||||
|
["<A-p>", "palette_menu_up"],
|
||||||
|
["<A-l>", "toggle_panel"],
|
||||||
|
["<A-i>", "toggle_inputview"],
|
||||||
|
|
||||||
|
["<F9>", "theme_prev"],
|
||||||
|
["<F10>", "theme_next"],
|
||||||
|
["<F11>", "toggle_panel"],
|
||||||
|
["<F12>", "toggle_inputview"],
|
||||||
|
["<Esc>", "palette_menu_cancel"],
|
||||||
|
["<Up>", "palette_menu_up"],
|
||||||
|
["<Down>", "palette_menu_down"],
|
||||||
|
["<PageUp>", "palette_menu_pageup"],
|
||||||
|
["<PageDown>", "palette_menu_pagedown"],
|
||||||
|
["<CR>", "palette_menu_activate"],
|
||||||
|
["<Backspace>", "overlay_delete_backwards"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"vim": {
|
"vim": {
|
||||||
"normal": {
|
"normal": {
|
||||||
"on_match_failure": "ignore",
|
"on_match_failure": "ignore",
|
||||||
|
@ -61,49 +297,5 @@
|
||||||
["<A-x>", "open_command_palette"]
|
["<A-x>", "open_command_palette"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"home": {
|
|
||||||
"normal": {
|
|
||||||
"on_match_failure": "ignore",
|
|
||||||
"bindings": [
|
|
||||||
["<C-f><C-f><C-f><C-f><C-f>", "home_sheeran"],
|
|
||||||
["<C-j>", "toggle_panel"],
|
|
||||||
["<C-q>", "quit"],
|
|
||||||
["<C-w>", "quit"],
|
|
||||||
["<C-o>", "open_file"],
|
|
||||||
["<C-e>", "open_recent"],
|
|
||||||
["<C-r>", "open_recent_project"],
|
|
||||||
["<C-p>", "open_command_palette"],
|
|
||||||
["<C-k><C-t>", "change_theme"],
|
|
||||||
["<C-S-p>", "open_command_palette"],
|
|
||||||
["<C-S-q>", "quit_without_saving"],
|
|
||||||
["<C-S-r>", "restart"],
|
|
||||||
["<C-S-f>", "find_in_files"],
|
|
||||||
["<C-S-l>", "toggle_panel"],
|
|
||||||
["<A-S-p>", "open_command_palette"],
|
|
||||||
["<A-n>", "goto_next_file_or_diagnostic"],
|
|
||||||
["<A-p>", "goto_prev_file_or_diagnostic"],
|
|
||||||
["<A-l>", "toggle_panel"],
|
|
||||||
["<A-i>", "toggle_inputview"],
|
|
||||||
["<A-x>", "open_command_palette"],
|
|
||||||
["h", "open_help"],
|
|
||||||
["o", "open_file"],
|
|
||||||
["e", "open_recent"],
|
|
||||||
["r", "open_recent_project"],
|
|
||||||
["p", "open_command_palette"],
|
|
||||||
["c", "open_config"],
|
|
||||||
["t", "change_theme"],
|
|
||||||
["q", "quit"],
|
|
||||||
["<F1>", "open_help"],
|
|
||||||
["<F6>", "open_config"],
|
|
||||||
["<F9>", "theme_prev"],
|
|
||||||
["<F10>", "theme_next"],
|
|
||||||
["<F11>", "toggle_panel"],
|
|
||||||
["<F12>", "toggle_inputview"],
|
|
||||||
["<Up>", "home_menu_up"],
|
|
||||||
["<Down>", "home_menu_down"],
|
|
||||||
["<CR>", "home_menu_activate"]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue