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();
}
}
[To try this out copy the text and put it in a new buffer, the help text above
confuses the jump commands]
Starting with the cursor on "body_two()", using "[m" will jump to the '{' at
the start of "method_two()" (obviously this is much more useful when the
method is long!). Using "2[m" will jump to the start of "method_one()".
Using "3[m" will jump to the start of the class.
*[#*
[# Go to [count] previous unmatched "#if" or "#else".
|exclusive| motion.
*]#*
]# Go to [count] next unmatched "#else" or "#endif".
|exclusive| motion.
These two commands work in C programs that contain #if/#else/#endif
constructs. It brings you to the start or end of the #if/#else/#endif where
the current line is included. You can then use "%" to go to the matching line.
*[star* *[/*
[* or [/ Go to [count] previous start of a C comment "/*".
|exclusive| motion.
*]star* *]/*
]* or ]/ Go to [count] next end of a C comment "*/".
|exclusive| motion.
*H*
H To line [count] from top (Home) of window (default:
first line on the window) on the first non-blank
character |linewise|. See also 'startofline' option.
Cursor is adjusted for 'scrolloff' option, unless an
operator is pending, in which case the text may
scroll. E.g. "yH" yanks from the first visible line
until the cursor line (inclusive).
*M*
M To Middle line of window, on the first non-blank
character |linewise|. See also 'startofline' option.
*L*
L To line [count] from bottom of window (default: Last
line on the window) on the first non-blank character
|linewise|. See also 'startofline' option.
Cursor is adjusted for 'scrolloff' option, unless an
operator is pending, in which case the text may
scroll. E.g. "yL" yanks from the cursor to the last
visible line.
<LeftMouse> Moves to the position on the screen where the mouse
click is |exclusive|. See also |<LeftMouse>|. If the
position is in a status line, that window is made the
active window and the cursor is not moved.
vim:tw=78:ts=8:noet:ft=help:norl: