Add initial goto keybinds

This commit is contained in:
mars 2023-04-14 15:09:55 -04:00
parent 7f46721caf
commit 1496a39a1a
1 changed files with 10 additions and 2 deletions

View File

@ -50,6 +50,11 @@ impl Default for Keybinds {
(End, goto_line_end_newline),
];
let goto_keys = &[
(Char('h'), goto_line_start as Action),
(Char('l'), goto_line_end_newline),
];
let normalish_keys = [
(Char(':'), command_mode as Action),
(Char('h'), move_char_left),
@ -68,6 +73,9 @@ impl Default for Keybinds {
.iter()
.chain(basic_nav);
let normalish_submodes: HashMap<Key, KeyMap> =
[(Char('g'), key_map_from_iter(goto_keys))].into();
let insert_keys = [
(Backspace, delete_char_backward as Action),
(Delete, delete_char_forward),
@ -78,7 +86,7 @@ impl Default for Keybinds {
Self {
normal: ModeKeys {
submodes: [].into(),
submodes: normalish_submodes.clone(),
map: key_map_from_iter(normalish_keys.clone()),
},
insert: ModeKeys {
@ -86,7 +94,7 @@ impl Default for Keybinds {
map: key_map_from_iter(insert_keys),
},
visual: ModeKeys {
submodes: [].into(),
submodes: normalish_submodes,
map: key_map_from_iter(normalish_keys.clone()),
},
}