Skip to content

Commit dbec057

Browse files
Rename I/A "Insert at start/end of line" (#3753)
* keymap: Rename A "Insert at end of line" The language for the `A` binding is potentially confusing because `A` behaves like `i` done at the end of the line rather than `a`. This change renames the command to match Kakoune's language[^1]. [^1]: https://github.com/mawww/kakoune/blob/021da117cf90bf25b65e3344fa8e43ab4262b714/src/normal.cc#L2229 * keymap: Rename I `insert_at_line_start`
1 parent 772af7f commit dbec057

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

book/src/keymap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
6969
| `i` | Insert before selection | `insert_mode` |
7070
| `a` | Insert after selection (append) | `append_mode` |
71-
| `I` | Insert at the start of the line | `prepend_to_line` |
72-
| `A` | Insert at the end of the line | `append_to_line` |
71+
| `I` | Insert at the start of the line | `insert_at_line_start` |
72+
| `A` | Insert at the end of the line | `insert_at_line_end` |
7373
| `o` | Open new line below selection | `open_below` |
7474
| `O` | Open new line above selection | `open_above` |
7575
| `.` | Repeat last insert | N/A |

helix-term/src/commands.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ impl MappableCommand {
273273
diagnostics_picker, "Open diagnostic picker",
274274
workspace_diagnostics_picker, "Open workspace diagnostic picker",
275275
last_picker, "Open last picker",
276-
prepend_to_line, "Insert at start of line",
277-
append_to_line, "Append to end of line",
276+
insert_at_line_start, "Insert at start of line",
277+
insert_at_line_end, "Insert at end of line",
278278
open_below, "Open new line below selection",
279279
open_above, "Open new line above selection",
280280
normal_mode, "Enter normal mode",
@@ -2483,13 +2483,13 @@ fn last_picker(cx: &mut Context) {
24832483
}
24842484

24852485
// I inserts at the first nonwhitespace character of each line with a selection
2486-
fn prepend_to_line(cx: &mut Context) {
2486+
fn insert_at_line_start(cx: &mut Context) {
24872487
goto_first_nonwhitespace(cx);
24882488
enter_insert_mode(cx);
24892489
}
24902490

24912491
// A inserts at the end of each line with a selection
2492-
fn append_to_line(cx: &mut Context) {
2492+
fn insert_at_line_end(cx: &mut Context) {
24932493
enter_insert_mode(cx);
24942494
let (view, doc) = current!(cx.editor);
24952495

helix-term/src/keymap/default.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ pub fn default() -> HashMap<Mode, Keymap> {
5959
":" => command_mode,
6060

6161
"i" => insert_mode,
62-
"I" => prepend_to_line,
62+
"I" => insert_at_line_start,
6363
"a" => append_mode,
64-
"A" => append_to_line,
64+
"A" => insert_at_line_end,
6565
"o" => open_below,
6666
"O" => open_above,
6767

0 commit comments

Comments
 (0)