on master help sign in
Remove default insert mode movement bindings
e12690eSkyler Hawthorne
book/src/keymap.md+18−16
@@ -315,10 +315,12 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire
315
315
316## Insert Mode
316## Insert Mode
317
317
318−We support many readline/emacs style bindings in insert mode for
318+Insert mode bindings are somewhat minimal by default. Helix is designed to
319−convenience. These can be helpful for making simple modifications
319+be a modal editor, and this is reflected in the user experience and internal
320−without escaping to normal mode, but beware that you will not have an
320+mechanics. For example, changes to the text are only saved for undos when
321−undo-able "save point" until you return to normal mode.
321+escaping from insert mode to normal mode. For this reason, new users are
322+strongly encouraged to learn the modal editing paradigm to get the smoothest
323+experience.
322
324
323| Key | Description | Command |
325| Key | Description | Command |
324| ----- | ----------- | ------- |
326| ----- | ----------- | ------- |
@@ -327,23 +329,23 @@ undo-able "save point" until you return to normal mode.
327| `Ctrl-r` | Insert a register content | `insert_register` |
329| `Ctrl-r` | Insert a register content | `insert_register` |
328| `Ctrl-w`, `Alt-Backspace`, `Ctrl-Backspace` | Delete previous word | `delete_word_backward` |
330| `Ctrl-w`, `Alt-Backspace`, `Ctrl-Backspace` | Delete previous word | `delete_word_backward` |
329| `Alt-d`, `Alt-Delete`, `Ctrl-Delete` | Delete next word | `delete_word_forward` |
331| `Alt-d`, `Alt-Delete`, `Ctrl-Delete` | Delete next word | `delete_word_forward` |
330−| `Alt-b`, `Ctrl-Left` | Backward a word | `move_prev_word_end` |
331−| `Ctrl-b`, `Left` | Backward a char | `move_char_left` |
332−| `Alt-f`, `Ctrl-Right` | Forward a word | `move_next_word_start` |
333−| `Ctrl-f`, `Right` | Forward a char | `move_char_right` |
334−| `Ctrl-e`, `End` | Move to line end | `goto_line_end_newline` |
335−| `Ctrl-a`, `Home` | Move to line start | `goto_line_start` |
336| `Ctrl-u` | Delete to start of line | `kill_to_line_start` |
332| `Ctrl-u` | Delete to start of line | `kill_to_line_start` |
337| `Ctrl-k` | Delete to end of line | `kill_to_line_end` |
333| `Ctrl-k` | Delete to end of line | `kill_to_line_end` |
338| `Ctrl-j`, `Enter` | Insert new line | `insert_newline` |
334| `Ctrl-j`, `Enter` | Insert new line | `insert_newline` |
339| `Backspace`, `Ctrl-h` | Delete previous char | `delete_char_backward` |
335| `Backspace`, `Ctrl-h` | Delete previous char | `delete_char_backward` |
340| `Delete`, `Ctrl-d` | Delete next char | `delete_char_forward` |
336| `Delete`, `Ctrl-d` | Delete next char | `delete_char_forward` |
337+
338+However, if you really want navigation in insert mode, this is supported. An
339+example config that gives the ability to use arrow keys while still in insert
340+mode:
341+
342+```toml
343+[keys.insert]
341−| `Ctrl-p`, `Up` | Move to previous line | `move_line_up` |
344+up = "move_line_up"
342−| `Ctrl-n`, `Down` | Move to next line | `move_line_down` |
345+down = "move_line_down"
343−| `PageUp` | Move one page up | `page_up` |
346+left = "move_char_left"
344−| `PageDown` | Move one page down | `page_down` |
347+right = "move_char_right"
345−| `Alt->` | Go to end of buffer | `goto_file_end` |
348+```
346−| `Alt-<` | Go to start of buffer | `goto_file_start` |
347
349
348## Select / extend mode
350## Select / extend mode
349
351
helix-term/src/keymap/default.rs−19
@@ -355,25 +355,6 @@ pub fn default() -> HashMap<Mode, Keymap> {
355 "A-del" => delete_word_forward,
355 "A-del" => delete_word_forward,
356 "C-s" => commit_undo_checkpoint,
356 "C-s" => commit_undo_checkpoint,
357
357
358− "left" => move_char_left,
359− "C-b" => move_char_left,
360− "down" => move_line_down,
361− "up" => move_line_up,
362− "right" => move_char_right,
363− "C-f" => move_char_right,
364− "A-b" => move_prev_word_end,
365− "C-left" => move_prev_word_end,
366− "A-f" => move_next_word_start,
367− "C-right" => move_next_word_start,
368− "A-<" => goto_file_start,
369− "A->" => goto_file_end,
370− "pageup" => page_up,
371− "pagedown" => page_down,
372− "home" => goto_line_start,
373− "C-a" => goto_line_start,
374− "end" => goto_line_end_newline,
375− "C-e" => goto_line_end_newline,
376−
377 "C-k" => kill_to_line_end,
358 "C-k" => kill_to_line_end,
378 "C-u" => kill_to_line_start,
359 "C-u" => kill_to_line_start,
379
360