jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.74k stars 106 forks source link

Behavior of backspace inconsistent with other commands #55

Closed vks closed 6 years ago

vks commented 6 years ago

Backspace leaves you in insert mode, which is inconsistent with the other delete commands and undocumented.

jmacdonald commented 6 years ago

Right. I added that change recently after realizing that I was very rarely using backspace without inserting another value. Agreed that it's inconsistent, though; you can change that in the keymap if you'd like:

keymap:
  normal:
    backspace:
      - buffer::backspace
      - application::switch_to_normal_mode

I've realized that this "switch to insert mode" behaviour is in the buffer::backspace command itself; I may move that into the default keymap instead (that'll make the above keymap only require backspace: buffer::backspace). Leaving this issue open as a reminder to do that; I'll follow up here once that's landed.

jmacdonald commented 6 years ago

Okay, updated keymap to get the config you're after:

keymap:
  normal:
    backspace: buffer::backspace

Hope that helps!