more emacs bindings

This commit is contained in:
Jonathan Marler 2025-01-06 11:38:52 -07:00 committed by CJ van den Berg
parent c7d6bd6805
commit 064522959b
2 changed files with 15 additions and 2 deletions

View file

@ -5,6 +5,7 @@
["ctrl+shift+-", "undo"],
["ctrl+a", "move_begin"],
["ctrl+k", ["select_end"], ["cut"]],
["ctrl+w", "cut"],
["alt+shift+,", "move_buffer_begin"],
["alt+shift+.", "move_buffer_end"],
["ctrl+e", "move_end"],
@ -15,8 +16,10 @@
["ctrl+n", "move_down"],
["ctrl+v", "move_page_down"],
["alt+v", "move_page_up"],
["ctrl+d", "delete_forward"],
["alt+d", ["select_word_right"], ["cut"]],
["ctrl+y", "system_paste"],
["ctrl+x>ctrl+f", "open_file"],
["ctrl+x>ctrl+f", "open_recent"],
["ctrl+x>k", "close_file"],
["ctrl+x>ctrl+c", "quit"],
["ctrl+x>ctrl+s", "save_file"],
@ -25,6 +28,11 @@
["alt+x", "open_command_palette"]
]
},
"overlay/palette": {
"press": [
["ctrl+a", "palette_menu_top"]
]
},
"mini/file_browser": {
"press": [
["alt+backspace", "mini_mode_delete_to_previous_path_segment"]
@ -34,7 +42,7 @@
"on_match_failure": "ignore",
"press": [
["ctrl+h>ctrl+a", "open_help"],
["ctrl+x>ctrl+f", "open_file"],
["ctrl+x>ctrl+f", "open_recent"],
["alt+x", "open_command_palette"],
["ctrl+x>ctrl+c", "quit"]
]

View file

@ -271,6 +271,11 @@ const cmds = struct {
const Ctx = command.Context;
const Result = command.Result;
pub fn palette_menu_top(self: *Self, _: Ctx) Result {
self.menu.select_first();
}
pub const palette_menu_top_meta = .{};
pub fn palette_menu_down(self: *Self, _: Ctx) Result {
self.menu.select_down();
}