Skip to content

Commit 39b9aae

Browse files
committed
Add back changes from helix-editor#3827
1 parent 746b60a commit 39b9aae

File tree

2 files changed

+72
-8
lines changed

2 files changed

+72
-8
lines changed

book/src/generated/static-cmd.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,12 @@ looking over text and not actively editing it).
272272
| `n` | Select next search match | `search_next` |
273273
| `N` | Select previous search match | `search_prev` |
274274
## Insert
275-
We support many readline/emacs style bindings in insert mode for convenience.
276-
These can be helpful for making simple modifications without escaping to normal
277-
mode, but beware that you will not have an undo-able "save point" until you
278-
return to normal mode.
275+
Insert mode bindings are somewhat minimal by default. Helix is designed to
276+
be a modal editor, and this is reflected in the user experience and internal
277+
mechanics. For example, changes to the text are only saved for undos when
278+
escaping from insert mode to normal mode. For this reason, new users are
279+
strongly encouraged to learn the modal editing paradigm to get the smoothest
280+
experience.
279281

280282
| Key | Description | Command |
281283
| --- | --- | --- |
@@ -291,6 +293,34 @@ return to normal mode.
291293
| `C-u` | Delete till start of line | `kill_to_line_start` |
292294
| `C-x` | Invoke completion popup | `completion` |
293295
| `C-r` | Insert register | `insert_register` |
296+
297+
However, if you really want navigation in insert mode, this is supported. An
298+
example config that gives the ability to use arrow keys while still in insert
299+
mode:
300+
301+
```toml
302+
[keys.insert]
303+
"up" = "move_line_up"
304+
"down" = "move_line_down"
305+
"left" = "move_char_left"
306+
"right" = "move_char_right"
307+
"C-b" = "move_char_left"
308+
"C-f" = "move_char_right"
309+
"A-b" = "move_prev_word_end"
310+
"C-left" = "move_prev_word_end"
311+
"A-f" = "move_next_word_start"
312+
"C-right" = "move_next_word_start"
313+
"A-<" = "goto_file_start"
314+
"A->" = "goto_file_end"
315+
"pageup" = "page_up"
316+
"pagedown" = "page_down"
317+
"home" = "goto_line_start"
318+
"C-a" = "goto_line_start"
319+
"end" = "goto_line_end_newline"
320+
"C-e" = "goto_line_end_newline"
321+
"A-left" = "goto_line_start"
322+
```
323+
294324
## Select
295325
This mode echoes Normal mode, but changes any movements to extend
296326
selections rather than replace them. Goto motions are also changed to

book/src/modes/insert.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,38 @@
1-
We support many readline/emacs style bindings in insert mode for convenience.
2-
These can be helpful for making simple modifications without escaping to normal
3-
mode, but beware that you will not have an undo-able "save point" until you
4-
return to normal mode.
1+
Insert mode bindings are somewhat minimal by default. Helix is designed to
2+
be a modal editor, and this is reflected in the user experience and internal
3+
mechanics. For example, changes to the text are only saved for undos when
4+
escaping from insert mode to normal mode. For this reason, new users are
5+
strongly encouraged to learn the modal editing paradigm to get the smoothest
6+
experience.
7+
8+
9+
10+
11+
12+
13+
However, if you really want navigation in insert mode, this is supported. An
14+
example config that gives the ability to use arrow keys while still in insert
15+
mode:
16+
17+
```toml
18+
[keys.insert]
19+
"up" = "move_line_up"
20+
"down" = "move_line_down"
21+
"left" = "move_char_left"
22+
"right" = "move_char_right"
23+
"C-b" = "move_char_left"
24+
"C-f" = "move_char_right"
25+
"A-b" = "move_prev_word_end"
26+
"C-left" = "move_prev_word_end"
27+
"A-f" = "move_next_word_start"
28+
"C-right" = "move_next_word_start"
29+
"A-<" = "goto_file_start"
30+
"A->" = "goto_file_end"
31+
"pageup" = "page_up"
32+
"pagedown" = "page_down"
33+
"home" = "goto_line_start"
34+
"C-a" = "goto_line_start"
35+
"end" = "goto_line_end_newline"
36+
"C-e" = "goto_line_end_newline"
37+
"A-left" = "goto_line_start"
38+
```

0 commit comments

Comments
 (0)