diff options
author | Antoni Stevent | 2021-06-02 18:00:43 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-03 14:24:24 +0000 |
commit | f0fe558f38aca040f00776575983cacbe9b7d011 (patch) | |
tree | d2fca0687f07d301a417c4ee9eef31ffafa7b59b /helix-term/src | |
parent | 09a7db637e028cac5f5b035e7084838d2a608897 (diff) |
Add up/right/left/down arrow keymaps, similar to kakoune
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/keymap.rs | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index de569656..b7011c92 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -35,10 +35,10 @@ use std::collections::HashMap; // f = find_char() // g = goto (gg, G, gc, gd, etc) // -// h = move_char_left(n) -// j = move_line_down(n) -// k = move_line_up(n) -// l = move_char_right(n) +// h = move_char_left(n) || arrow-left = move_char_left(n) +// j = move_line_down(n) || arrow-down = move_line_down(n) +// k = move_line_up(n) || arrow_up = move_line_up(n) +// l = move_char_right(n) || arrow-right = move_char_right(n) // : = command line // ; = collapse selection to cursor // " = use register @@ -128,6 +128,24 @@ pub fn default() -> Keymaps { key!('k') => commands::move_line_up, key!('l') => commands::move_char_right, + KeyEvent { + code: KeyCode::Left, + modifiers: KeyModifiers::NONE + } => commands::move_char_left as Command, + KeyEvent { + code: KeyCode::Down, + modifiers: KeyModifiers::NONE + } => commands::move_line_down, + KeyEvent { + code: KeyCode::Up, + modifiers: KeyModifiers::NONE + } => commands::move_line_up, + KeyEvent { + code: KeyCode::Right, + modifiers: KeyModifiers::NONE + } => commands::move_char_right, + + key!('t') => commands::find_till_char, key!('f') => commands::find_next_char, key!('T') => commands::till_prev_char, @@ -269,6 +287,23 @@ pub fn default() -> Keymaps { key!('k') => commands::extend_line_up, key!('l') => commands::extend_char_right, + KeyEvent { + code: KeyCode::Left, + modifiers: KeyModifiers::NONE + } => commands::move_char_left as Command, + KeyEvent { + code: KeyCode::Down, + modifiers: KeyModifiers::NONE + } => commands::move_line_down, + KeyEvent { + code: KeyCode::Up, + modifiers: KeyModifiers::NONE + } => commands::move_line_up, + KeyEvent { + code: KeyCode::Right, + modifiers: KeyModifiers::NONE + } => commands::move_char_right, + key!('w') => commands::extend_next_word_start, key!('b') => commands::extend_prev_word_start, key!('e') => commands::extend_next_word_end, |