'Matching square brackets in vim
I am aware of the shortcut for flower braces i.e. Having cursor over {
and pressing ]}
gets me to the corresponding }
. How to do the same for matching square brackets? []
Solution 1:[1]
In normal mode, try
vi[oh
vi[
should visually select the entire block between []
, and o
switch cursor to the front of visual selection, then h
moves cursor onto [
.
At the expense of more keystrokes, this works in more cases than %
where you must hover over the bracket.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Terry |