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]: 021da117cf/src/normal.cc (L2229)

* keymap: Rename I `insert_at_line_start`
pull/1/head
Michael Davis 2 years ago committed by GitHub
parent 772af7ffb1
commit dbec057363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -68,8 +68,8 @@
| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` | | `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
| `i` | Insert before selection | `insert_mode` | | `i` | Insert before selection | `insert_mode` |
| `a` | Insert after selection (append) | `append_mode` | | `a` | Insert after selection (append) | `append_mode` |
| `I` | Insert at the start of the line | `prepend_to_line` | | `I` | Insert at the start of the line | `insert_at_line_start` |
| `A` | Insert at the end of the line | `append_to_line` | | `A` | Insert at the end of the line | `insert_at_line_end` |
| `o` | Open new line below selection | `open_below` | | `o` | Open new line below selection | `open_below` |
| `O` | Open new line above selection | `open_above` | | `O` | Open new line above selection | `open_above` |
| `.` | Repeat last insert | N/A | | `.` | Repeat last insert | N/A |

@ -273,8 +273,8 @@ impl MappableCommand {
diagnostics_picker, "Open diagnostic picker", diagnostics_picker, "Open diagnostic picker",
workspace_diagnostics_picker, "Open workspace diagnostic picker", workspace_diagnostics_picker, "Open workspace diagnostic picker",
last_picker, "Open last picker", last_picker, "Open last picker",
prepend_to_line, "Insert at start of line", insert_at_line_start, "Insert at start of line",
append_to_line, "Append to end of line", insert_at_line_end, "Insert at end of line",
open_below, "Open new line below selection", open_below, "Open new line below selection",
open_above, "Open new line above selection", open_above, "Open new line above selection",
normal_mode, "Enter normal mode", normal_mode, "Enter normal mode",
@ -2483,13 +2483,13 @@ fn last_picker(cx: &mut Context) {
} }
// I inserts at the first nonwhitespace character of each line with a selection // I inserts at the first nonwhitespace character of each line with a selection
fn prepend_to_line(cx: &mut Context) { fn insert_at_line_start(cx: &mut Context) {
goto_first_nonwhitespace(cx); goto_first_nonwhitespace(cx);
enter_insert_mode(cx); enter_insert_mode(cx);
} }
// A inserts at the end of each line with a selection // A inserts at the end of each line with a selection
fn append_to_line(cx: &mut Context) { fn insert_at_line_end(cx: &mut Context) {
enter_insert_mode(cx); enter_insert_mode(cx);
let (view, doc) = current!(cx.editor); let (view, doc) = current!(cx.editor);

@ -59,9 +59,9 @@ pub fn default() -> HashMap<Mode, Keymap> {
":" => command_mode, ":" => command_mode,
"i" => insert_mode, "i" => insert_mode,
"I" => prepend_to_line, "I" => insert_at_line_start,
"a" => append_mode, "a" => append_mode,
"A" => append_to_line, "A" => insert_at_line_end,
"o" => open_below, "o" => open_below,
"O" => open_above, "O" => open_above,

Loading…
Cancel
Save