aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorIvan Tham2022-10-03 15:08:15 +0000
committerGitHub2022-10-03 15:08:15 +0000
commit3d59d3f8be214ddb5b75d6a9df5f0ea1fff5f31c (patch)
tree23cda72fba1d6675e0706342aef7daf609df3d74 /helix-term
parent1d8bb2249b7153b2e9d3591534bdca32176c9975 (diff)
Keep arrow and special keys in insert (#3915)
* Keep arrow and special keys in insert Advanced users won't need it and is useful for beginners. Revert part of #3671. * Change text for insert mode section Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> * Remove ctrl-up/down in insert * Reorganize insert keys and docs * Improve page up experience on last tutor The last tutor page can page down multiple times and it will break the heading on the 80x24 screen paging when reaching the last page, this keeps the style the same and make sure page up and down won't break it. Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/keymap/default.rs31
1 files changed, 17 insertions, 14 deletions
diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs
index 4da609ec..6c327ee6 100644
--- a/helix-term/src/keymap/default.rs
+++ b/helix-term/src/keymap/default.rs
@@ -343,24 +343,27 @@ pub fn default() -> HashMap<Mode, Keymap> {
let insert = keymap!({ "Insert mode"
"esc" => normal_mode,
- "backspace" => delete_char_backward,
- "C-h" => delete_char_backward,
- "del" => delete_char_forward,
- "C-d" => delete_char_forward,
- "ret" => insert_newline,
- "C-j" => insert_newline,
- "tab" => insert_tab,
- "C-w" => delete_word_backward,
- "A-backspace" => delete_word_backward,
- "A-d" => delete_word_forward,
- "A-del" => delete_word_forward,
"C-s" => commit_undo_checkpoint,
+ "C-x" => completion,
+ "C-r" => insert_register,
- "C-k" => kill_to_line_end,
+ "C-w" | "A-backspace" => delete_word_backward,
+ "A-d" | "A-del" => delete_word_forward,
"C-u" => kill_to_line_start,
+ "C-k" => kill_to_line_end,
+ "C-h" | "backspace" => delete_char_backward,
+ "C-d" | "del" => delete_char_forward,
+ "C-j" | "ret" => insert_newline,
+ "tab" => insert_tab,
- "C-x" => completion,
- "C-r" => insert_register,
+ "up" => move_line_up,
+ "down" => move_line_down,
+ "left" => move_char_left,
+ "right" => move_char_right,
+ "pageup" => page_up,
+ "pagedown" => page_down,
+ "home" => goto_line_start,
+ "end" => goto_line_end_newline,
});
hashmap!(
Mode::Normal => Keymap::new(normal),