Why does "a"-key extend selection?

I keep finding it odd that when I press “a” in w|o|rd and type nnn, I get w|onnn|d selection. This is especially strange when I edit code and decide to insert new block in curlys, and I hit a, then type { then press enter and the selection keeps extending on new lines.

I almost never want this behavior, usually I enter insert mode (with a) edit something, exit afterwards, proceed to other edits.

What’s the big idea behind a doing the extending? Why does i not extend selection while a does? Maybe I miss something useful?

Because if you press a immediately followed with <esc> you will observe selection is preserved. Now how do you imagine typing in while preserving selections? Somehow text has to be inserted before cursors.

But why does it preserve selection in the first place? I just find that 99% of the time I press a with cursor-only selection and I actually don’t want to preserve it, I want to type my thing and be done, and I won’t do anything with the text I have just typed.

It’s like if in vim I would activate a visual mode and then start inserting while keeping it – I never needed that.

I’ve found those issues:

2 Likes

Great, I will read up, thank you!

UPD: Oh, one of the issues mentioned that this is even contained in the FAQ, sorry that I didn’t read it, will also do that :slight_smile:

1 Like

You can change the a behavior with the following mapping.

map global normal a '<a-:>li'

Note it may have side effects at the end of the buffer, as you are moving right.

1 Like

Thanks! I’ve decided that I’ll try to use this as it is, maybe I’ll get used to it and maybe I’ll find uses for this. If not, I’ll have the option to change as you’ve suggested!