Pressing "C" one more time than I want

Sometimes I want to create several multiple selections on the same column, in theory a perfect application for the C command. However, I often press C one more time than I wanted and then have to start again. : (

Is there a way to “undo” the C and remove the last selection from the set of selections? Or, alternatively, is there another way to create multiple selections on the same column that doesn’t have this shortcoming?

In :doc keys multiple-selections, the section that describes the <C> command, it also mentions <,> (comma), the key to drop all selections except the main selection, and <a-,>, the key to drop the main selection and leave the others.

When you press C, the newly created selection becomes the main selection, so you can use <a-,> to drop it and go back to the way things were before.

2 Likes

Hi, maybe you’d find this plugin of mine useful, GitHub - eko234/kakoune-rectangles, you can make the shape you want with shift and then create the “rectangle”, hope it helps.

There is a undo selection feature in kakoune master since this commit
You should be able to use ctrl-h (<c-h>) to undo the last C.

1 Like

The undo selection mapping has been changed to <a-u> in this commit.