6

Let's say I have this piece of code (cursor/selection is represented by []):

[f]unction a()
{
    // ...
}

If I want to select the function declaration and the curly braces (and of course the content) I can do Vj%, which select the first line, goes to the opening { and jump to the matching }.

Or I can do jVa{ok which goes down to select around the {}, goes back to the start of the selection and move up to select the remaining line.

Now the question: why can't I do Vja{?

I thought it could select the first line, then move down and expand around the curly braces.

Why is this not possible?

Sato Katsura
  • 4,009
  • 17
  • 24
nobe4
  • 16,033
  • 4
  • 48
  • 81

1 Answers1

9

It's trying to select the block that encompasses all of the selection. Since your selection is "leaking" out of the block and there's no other block containing it, it fails. Try Vja{ on this to see what I mean:

{
   [f]unction a()
   {
       // ...
   }
}
Tumbler41
  • 7,746
  • 1
  • 21
  • 48
  • Nicely found, I thought the "inside"/"around" were for the cursor and not the position. – nobe4 Jun 23 '16 at 22:07