开发者

Is there a vim command to move the cursor to the parent bracket?

开发者 https://www.devze.com 2023-01-28 06:55 出处:网络
Is there a vim command to move the cursor to the parent bracket? I have a config开发者_如何学JAVAuration file like this one, and I want to go straight to the parent bracket.Is there a simple movement

Is there a vim command to move the cursor to the parent bracket?

I have a config开发者_如何学JAVAuration file like this one, and I want to go straight to the parent bracket. Is there a simple movement command to do this, or is there a way to combine commands to do what I want?

PARENT{ // I want to move my cursor here

   CHILD { stuff... }
   CHILD { stuff... }
   CHILD { stuff... }

...

   CHILD { stuff... } // my cursor is on this line
   CHILD { GRANDCHILD { more stuff } }
   CHILD { stuff... }
}


Yes. Do [{ in normal mode for that. It might not work for all languages though.

Many move commands are available at :help [.


Also you can press % and it will show your open or close bracket


It looks like [[ does what you want. And ][ moves to the bottom-most brace. (With many thanks to @Benoit for cluing me in that this might be possible...)

0

精彩评论

暂无评论...
验证码 换一张
取 消