Search code examples
vscodevim

Vim: Moving cursor to the end of a block


Given that I am in the middle of a code block, I want to go to the end of the block without using h,j,k,l.

I am looking for similar behaviour with %, which will also work when my cursor is somewhere in the code block.

Example:

enter image description here

I want to move the cursor to where to the line 22, where Container block ends.

I would appreciate for your help, thanks.


Solution

  • Take a look at the following commands:

    ]) -> Move the cursor to the closed closing of first bracket '('
    ]} -> Move the cursor to the closed closing of second bracket '{'
    

    As you are looking for the nearest first bracket, the first one should work for your case.