So if I've got text like:
if answer == 42 { #1
if bugs == 'bunny' { #2
if injury == 'but a scratch' { #3
// do the thing #4
} #5
} #6
} #7
and I've got my cursor on // do the thing
and do the va{
command, then I'll select the {}
from lines 3 to 5, and if I do a{
again then I'll select {}
from lines 2 to 6.
But oh no, I now realize that I actually only wanted to select the {}
from lines 3 to 5. To my horror, the usual vim method of capitalisation => opposite
doesn't work and A{
simply appends a {
to the end of the line.
Can I go from a large selection to a smaller one without cancelling the selection, moving my cursor and doing it all over? In this example it would also be simple enough to use some of hjklwbeo
to change the selection manually, but in practice the code blocks are long and non-trivial.
I'm aware that this would be ambiguous if there are multiple sibling blocks within one parent blocks, but I'd be happy with just selecting the first one since that rarely happens to me.
Thanks!
Edit: A plugin that does this would be a good alternative. If it looks like none exists, then I'll make a quick MVP and post a link here for comments.