around
matches.
No count is allowed, {count}% jumps to a line {count}
percentage down the file |N%|. Using '%' on
#if/#else/#endif makes the movement linewise.
*[(*
[( Go to [count] previous unmatched '('.
|exclusive| motion.
*[{*
[{ Go to [count] previous unmatched '{'.
|exclusive| motion.
*])*
]) Go to [count] next unmatched ')'.
|exclusive| motion.
*]}*
]} Go to [count] next unmatched '}'.
|exclusive| motion.
The above four commands can be used to go to the start or end of the current
code block. It is like doing "%" on the "(", ")", "{" or "}" at the other
end of the code block, but you can do this from anywhere in the code block.
Very useful for C programs. Example: When standing on "case x:", `[{` will
bring you back to the switch statement.
*]m*
]m Go to [count] next start of a method (for Java or
similar structured language). When not before the
start of a method, jump to the start or end of the
class. |exclusive| motion.
*]M*
]M Go to [count] next end of a method (for Java or
similar structured language). When not before the end
of a method, jump to the start or end of the class.
|exclusive| motion.
*[m*
[m Go to [count] previous start of a method (for Java or
similar structured language). When not after the
start of a method, jump to the start or end of the
class. When no '{' is found before the cursor this is
an error. |exclusive| motion.
*[M*
[M Go to [count] previous end of a method (for Java or
similar structured language). When not after the
end of a method, jump to the start or end of the
class. When no '}' is found before the cursor this is
an error. |exclusive| motion.
The above two commands assume that the file contains a class with methods.
The class definition is surrounded in '{' and '}'. Each method in the class
is also surrounded with '{' and '}'. This applies to the Java language. The
file looks like this: >
// comment
class foo {
int method_one() {
body_one();
}
int method_two() {
body_two();