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...)
精彩评论