on master help sign in
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`

commitdbec057363201d6c4aa2e7258cac928e5ebb6a28 authorMichael Davis <mcarsondavis@gmail.com> dateMon 3 Oct 2022, 10:05 (4 years ago) parent772af7f
3 files changed+8−8
book/src/keymap.md+2−2 helix-term/src/commands.rs+4−4 helix-term/src/keymap/default.rs+2−2
book/src/keymap.md+2−2
@@ -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+4−4
@@ -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+2−2
@@ -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