Nvim :help
pages, generated
from source
using the tree-sitter-vimdoc parser.
navigation
CTRL-G
" command g_CTRL-G. If you set the 'ruler' option,
the cursor position is continuously shown in the status line (which slows down
Vim a little).motion-count-multiplied
If the motion includes a count and the operator also had a count before it,
the two counts are multiplied. For example: "2d3w" deletes six words.
operator-doubled
When doubling the operator it operates on a line. When using a count, before
or after the first character, that many lines are operated upon. Thus 3dd
deletes three lines. A count before and after the first character is
multiplied, thus 2y3y
yanks six lines.linewise
charwise
characterwise
The operator either affects whole lines, or the characters between the start
and end position. Generally, motions that move between lines affect lines
(are linewise), and motions that move within a line affect characters (are
charwise). However, there are some exceptions.exclusive
inclusive
Character motion is either inclusive or exclusive. When inclusive, the
start and end position of the motion are included in the operation. When
exclusive, the last character towards the end of the buffer is not included.
Linewise motions always include the start and end position. Plugins can
check the v:event.inclusive flag of the TextYankPost event.exclusive-linewise
2. If the motion is exclusive, the end of the motion is in column 1 and the
start of the motion was at or before the first non-blank in the line, the
motion becomes linewise. Example: If a paragraph begins with some blanks
and you do "d}" while standing on the first non-blank, all the lines of
the paragraph are deleted, including the blanks. If you do a put now, the
deleted lines will be inserted below the cursor position.d:call search("f")<CR>This cannot be repeated:
d:if 1<CR> call search("f")<CR> endif<CR>Note that when using ":" any motion becomes charwise exclusive.
forced-motion
FORCING A MOTION TO BE LINEWISE, CHARWISE OR BLOCKWISECTRL-V
just after the operator.
Example:djdeletes two lines
dvjdeletes from the cursor position until the character below the cursor
d<C-V>jdeletes the character under the cursor and the character below the cursor. Be careful with forcing a linewise movement to be used charwise or blockwise, the column may not always be defined.
o_v
v When used after an operator, before the motion command: Force
the operator to work charwise, also when the motion is
linewise. If the motion was linewise, it will become
exclusive.
If the motion already was charwise, toggle
inclusive/exclusive. This can be used to make an exclusive
motion inclusive and an inclusive motion exclusive.o_V
V When used after an operator, before the motion command: Force
the operator to work linewise, also when the motion is
charwise.o_CTRL-V
CTRL-V When used after an operator, before the motion command: Force
the operator to work blockwise. This works like Visual block
mode selection, with the corners defined by the cursor
position before and after the motion.h
<Left>
or <Left>
CTRL-H or CTRL-H
<BS>
<BS>
[count] characters to the left. exclusive motion.
Note: If you prefer <BS>
to delete a character, use
the mapping:
:map CTRL-V
<BS>
X
(to enter "CTRL-V<BS>" type the CTRL-V
key, followed
by the <BS>
key)l
<Right>
or <Right>
<Space>
<Space>
[count] characters to the right. exclusive motion.
See the 'whichwrap' option for adjusting the behavior
at end of line<Home>
<kHome>
<Home>
To the first character of the line. exclusive
motion. When moving up or down next, stay in same
TEXT column (if possible). Most other commands stay
in the same SCREEN column. <Home>
works like "1|",
which differs from "0" when the line starts with a
<Tab>
.$
<End>
<kEnd>
$ or <End>
To the end of the line. When a count is given also go
[count - 1] lines downward, or as far is possible.
inclusive motion. If a count of 2 or larger is
given and the cursor is on the last line, that is an
error and the cursor doesn't move.
In Visual mode the cursor goes to just after the last
character in the line.
When 'virtualedit' is active, "$" may move the cursor
back from past the end of the line to the last
character in the line.g0
g<Home>
g0 or g<Home> When lines wrap ('wrap' on): To the first character of
the screen line. exclusive motion. Differs from
"0" when a line is wider than the screen.
When lines don't wrap ('wrap' off): To the leftmost
character of the current line that is on the screen.
Differs from "0" when the first character of the line
is not on the screen.g^
g^ When lines wrap ('wrap' on): To the first non-blank
character of the screen line. exclusive motion.
Differs from "^" when a line is wider than the screen.
When lines don't wrap ('wrap' off): To the leftmost
non-blank character of the current line that is on the
screen. Differs from "^" when the first non-blank
character of the line is not on the screen.gm
gm Like "g0", but half a screenwidth to the right (or as
much as possible).gM
gM Like "g0", but to halfway the text of the line.
With a count: to this percentage of text in the line.
Thus "10gM" is near the start of the text and "90gM"
is near the end of the text.g$
g$ When lines wrap ('wrap' on): To the last character of
the screen line and [count - 1] screen lines downward
inclusive. Differs from "$" when a line is wider
than the screen.
When lines don't wrap ('wrap' off): To the rightmost
character of the current line that is visible on the
screen. Differs from "$" when the last character of
the line is not on the screen or when a count is used.
Additionally, vertical movements keep the column,
instead of going to the end of the line.
When 'virtualedit' is enabled moves to the end of the
screen line.f
f{char} To [count]'th occurrence of {char}
to the right. The
cursor is placed on {char}
inclusive.
{char}
can be entered as a digraph digraph-arg.
When 'encoding' is set to Unicode, composing
characters may be used, see utf-8-char-arg.
:lmap mappings apply to {char}
. The CTRL-^
command
in Insert mode can be used to switch this on/off
i_CTRL-^.F
F{char} To the [count]'th occurrence of {char}
to the left.
The cursor is placed on {char}
exclusive.
{char}
can be entered like with the f command.t
t{char} Till before [count]'th occurrence of {char}
to the
right. The cursor is placed on the character left of
{char}
inclusive.
{char}
can be entered like with the f command.T
T{char} Till after [count]'th occurrence of {char}
to the
left. The cursor is placed on the character right of
{char}
exclusive.
{char}
can be entered like with the f command.j
<Down>
or <Down>
CTRL-J or CTRL-J
<NL>
or <NL>
CTRL-N
CTRL-N [count] lines downward linewise.gk
g<Up>
g<Up> [count] display lines upward. exclusive motion.
Differs from 'k' when lines wrap, and when used with
an operator, because it's not linewise.gj
g<Down>
g<Down> [count] display lines downward. exclusive motion.
Differs from 'j' when lines wrap, and when used with
an operator, because it's not linewise.+
or +
CTRL-M or CTRL-M
<CR>
<CR>
[count] lines downward, on the first non-blank
character linewise.G
G Goto line [count], default last line, on the first
non-blank character linewise. If 'startofline' not
set, keep the same column.
G is one of the jump-motions.<C-Home>
or gg
<C-Home>
gg Goto line [count], default first line, on the first
non-blank character linewise. If 'startofline' not
set, keep the same column.:[range]
:[range] Set the cursor on the last line number in [range].
In Ex mode, print the lines in [range].
[range] can also be just one line number, e.g., ":1"
or ":'m".
In contrast with G this command does not modify the
jumplist.
N%
{count}
% Go to {count}
percentage in the file, on the first
non-blank in the line linewise. To compute the new
line number this formula is used:
({count}
* number-of-lines + 99) / 100
See also 'startofline' option.:go
:goto
go
[count]go Go to [count] byte in the buffer. exclusive motion.
Default [count] is one, start of the file. When
giving [range], the last number in it used as the byte
count. End-of-line characters are counted depending
on the current 'fileformat' setting.
Also see the line2byte() function, and the 'o'
option in 'statusline'.word
A word consists of a sequence of letters, digits and underscores, or a
sequence of other non-blank characters, separated with white space (spaces,
tabs, <EOL>
). This can be changed with the 'iskeyword' option. An empty line
is also considered to be a word.
WORD
A WORD consists of a sequence of non-blank characters, separated with white
space. An empty line is also considered to be a WORD.]]
]] [count] sections forward or to the next "{" in the
first column. When used after an operator, then also
stops below a "}" in the first column. exclusive
Note that exclusive-linewise often applies.][
][ [count] sections forward or to the next '}' in the
first column. exclusive
Note that exclusive-linewise often applies.[[
[[ [count] sections backward or to the previous "{" in
the first column. exclusive
Note that exclusive-linewise often applies.[]
[] [count] sections backward or to the previous "}" in
the first column. exclusive
Note that exclusive-linewise often applies.sentence
A sentence is defined as ending at a '.', '!' or '?' followed by either the
end of a line, or by a space or tab. Any number of closing ')', ']', '"'
and ''' characters may appear after the '.', '!' or '?' before the spaces,
tabs or end of line. A paragraph and section boundary is also a sentence
boundary.
If the 'J' flag is present in 'cpoptions', at least two spaces have to
follow the punctuation mark; <Tab>
s are not recognized as white space.
The definition of a sentence cannot be changed.paragraph
A paragraph begins after each empty line, and also at each of a set of
paragraph macros, specified by the pairs of characters in the 'paragraphs'
option. The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds to
the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in
the first column). A section boundary is also a paragraph boundary.
Note that a blank line (only containing white space) is NOT a paragraph
boundary.
Note: this does not include a '{' or '}' in the first column.section
A section begins after a form-feed (<C-L>
) in the first column and at each of
a set of section macros, specified by the pairs of characters in the
'sections' option. The default is "SHNHH HUnhsh", which defines a section to
start at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".:map [[ ?{<CR>w99[{ :map ][ /}<CR>b99]} :map ]] j0[[%/{<CR> :map [] k$][%?}<CR>[type these literally, see <>]
gn
and gN
, operating on the last search pattern.v_aw
aw
aw "a word", select [count] words (see word).
Leading or trailing white space is included, but not
counted.
When used in Visual linewise mode "aw" switches to
Visual charwise mode.v_iw
iw
iw "inner word", select [count] words (see word).
White space between words is counted too.
When used in Visual linewise mode "iw" switches to
Visual charwise mode.v_aW
aW
aW "a WORD", select [count] WORDs (see WORD).
Leading or trailing white space is included, but not
counted.
When used in Visual linewise mode "aW" switches to
Visual charwise mode.v_iW
iW
iW "inner WORD", select [count] WORDs (see WORD).
White space between words is counted too.
When used in Visual linewise mode "iW" switches to
Visual charwise mode.v_as
as
as "a sentence", select [count] sentences (see
sentence).
When used in Visual mode it is made charwise.v_is
is
is "inner sentence", select [count] sentences (see
sentence).
When used in Visual mode it is made charwise.v_ap
ap
ap "a paragraph", select [count] paragraphs (see
paragraph).
Exception: a blank line (only containing white space)
is also a paragraph boundary.
When used in Visual mode it is made linewise.v_ip
ip
ip "inner paragraph", select [count] paragraphs (see
paragraph).
Exception: a blank line (only containing white space)
is also a paragraph boundary.
When used in Visual mode it is made linewise.v_a]
v_a[
a]
a[
a[ "a [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
including the '[' and ']'. The cpo-M option flag
is used to handle escaped brackets.
When used in Visual mode it is made charwise.v_i]
v_i[
i]
i[
i[ "inner [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
excluding the '[' and ']'. It's an error to select an
empty inner block like "[]". The cpo-M option flag
is used to handle escaped brackets.
When used in Visual mode it is made charwise.v_a)
a)
a(
a( vab
v_ab
v_a(
ab
ab "a block", select [count] blocks, from "[count] [(" to
the matching ')', including the '(' and ')' (see
[(). Does not include white space outside of the
parenthesis. The cpo-M option flag is used to
handle escaped parenthesis.
When used in Visual mode it is made charwise.v_i)
i)
i(
i( vib
v_ib
v_i(
ib
ib "inner block", select [count] blocks, from "[count] [("
to the matching ')', excluding the '(' and ')' (see
[(). If the cursor is not inside a () block, then
find the next "(". It's an error to select an empty
inner block like "()". The cpo-M option flag
is used to handle escaped parenthesis.
When used in Visual mode it is made charwise.v_a>
v_a<
a>
a<
a< "a <> block", select [count] <> blocks, from the
[count]'th unmatched '<' backwards to the matching
'>', including the '<' and '>'. The cpo-M option flag
is used to handle escaped '<' and '>'.
When used in Visual mode it is made charwise.v_i>
v_i<
i>
i<
i< "inner <> block", select [count] <> blocks, from
the [count]'th unmatched '<' backwards to the matching
'>', excluding the '<' and '>'. It's an error to
select an empty inner block like "<>". The cpo-M
option flag is used to handle escaped '<' and '>'.
When used in Visual mode it is made charwise.v_at
at
at "a tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", including the "<aaa>" and "</aaa>".
See tag-blocks about the details.
When used in Visual mode it is made charwise.v_it
it
it "inner tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", excluding the "<aaa>" and "</aaa>".
See tag-blocks about the details.
When used in Visual mode it is made charwise.v_a}
a}
a{
a{ v_aB
v_a{
aB
aB "a Block", select [count] Blocks, from [count] [{
to
the matching "}", including the "{" and "}" (see
[{). The cpo-M option flag is used to handle
escaped braces.
When used in Visual mode it is made charwise.v_i}
i}
i{
i{ v_iB
v_i{
iB
iB "inner Block", select [count] Blocks, from [count] [{
to the matching "}", excluding the "{" and "}" (see
[{). It"s an error to select an empty inner block
like "{}". The cpo-M option flag is used to handle
escaped braces.
When used in Visual mode it is made charwise.v_aquote
aquote
a' v_a'
a'
a` v_a`
a`
"a quoted string". Selects the text from the previous
quote until the next quote. The 'quoteescape' option
is used to skip escaped quotes.
Only works within one line.
When the cursor starts on a quote, Vim will figure out
which quote pairs form a string by searching from the
start of the line.
Any trailing white space is included, unless there is
none, then leading white space is included.
When used in Visual mode it is made charwise.
Repeating this object in Visual mode another string is
included. A count is currently not used.v_iquote
iquote
i' v_i'
i'
i` v_i`
i`
Like a", a' and a`, but exclude the quotes and
repeating won't extend the Visual selection.
Special case: With a count of 2 the quotes are
included, but no extra white space as with a"/a'/a`.o_object-select
When used after an operator:
For non-block objects:
For the "a" commands: The operator applies to the object and the white
space after the object. If there is no white space after the object
or when the cursor was in the white space before the object, the white
space before the object is included.
For the "inner" commands: If the cursor was on the object, the
operator applies to the object. If the cursor was on white space, the
operator applies to the white space.
For a block object:
The operator applies to the block where the cursor is in, or the block
on which the cursor is on one of the braces. For the "inner" commands
the surrounding braces are excluded. For the "a" commands, the braces
are included.v_object-select
When used in Visual mode:
When start and end of the Visual area are the same (just after typing "v"):
One object is selected, the same as for using an operator.
When start and end of the Visual area are not the same:
For non-block objects the area is extended by one object or the white
space up to the next object, or both for the "a" objects. The
direction in which this happens depends on which side of the Visual
area the cursor is. For the block objects the block is extended one
level outwards.diw
"daw" delete a word daw
"diW" delete inner WORD (see WORD) diW
"daW" delete a WORD (see WORD) daW
"dgn" delete the next search pattern match dgn
"dd" delete one line dd
"dis" delete inner sentence dis
"das" delete a sentence das
"dib" delete inner '(' ')' block dib
"dab" delete a '(' ')' block dab
"dip" delete inner paragraph dip
"dap" delete a paragraph dap
"diB" delete inner '{' '}' block diB
"daB" delete a '{' '}' block daB
tag-blocks
<tag>
until the matching </tag>. For "at"
the tags are included, for "it" they are excluded. But when "it" is repeated
the tags will be included (otherwise nothing would change). Also, "it" used
on a tag block with no contents will select the leading tag.<br>
or <meta ...> without a
matching end tag. These are ignored.mark-view
3. Apart from the above if 'jumpoptions' contains "view", they will also try to
restore the mark view. This is the number of lines between the cursor position
and the window topline (first buffer line displayed in the window) when it was
set.m
mark
Mark
m{a-zA-Z} Set mark {a-zA-Z}
at cursor position (does not move
the cursor, this is not a motion command).m'
m`
m' or m` Set the previous context mark. This can be jumped to
with the "''" or "``" command (does not move the
cursor, this is not a motion command).m[
m]
m[ or m] Set the '[ or '] mark. Useful when an operator is
to be simulated by multiple commands. (does not move
the cursor, this is not a motion command).m<
m>
m< or m> Set the '< or '> mark. Useful to change what the
gv
command selects. (does not move the cursor, this
is not a motion command).
Note that the Visual mode cannot be set, only the
start and end position.:ma
:mark
E191
:[range]ma[rk] {a-zA-Z'}
Set mark {a-zA-Z'}
at last line number in [range],
column 0. Default is cursor line.:k
:[range]k{a-zA-Z'} Same as :mark, but the space before the mark name can
be omitted.'A
'0
`A
`0
'{A-Z0-9}
{A-Z0-9} To the mark {A-Z0-9} in the file where it was set (not
a motion command when in another file).g'
g'a
g`
g`a
g'{mark} g`{mark}
Jump to the {mark}
, but don't change the jumplist when
jumping within the current buffer. Example:g`"
:marks
:marks List all the current marks (not a motion command).
The '(, '), '{ and '} marks are not listed.
The first column has number zero.
E283
:marks {arg}
List the marks that are mentioned in {arg}
(not a
motion command). For example::marks aB
:delm
:delmarks
:delm[arks] {marks}
Delete the specified marks. Marks that can be deleted
include A-Z and 0-9. You cannot delete the ' mark.
They can be specified by giving the list of mark
names, or with a range, separated with a dash. Spaces
are ignored. Examples::delmarks a deletes mark a :delmarks a b 1 deletes marks a, b and 1 :delmarks Aa deletes marks A and a :delmarks p-z deletes marks in the range p to z :delmarks ^.[] deletes marks ^ . [ ] :delmarks \" deletes mark "
'<
`<
'<< To the first line or character of the last selected
Visual area in the current buffer. For block mode it
may also be the last character in the first line (to
be able to define the block).'>
`>
'>> To the last line or character of the last selected
Visual area in the current buffer. For block mode it
may also be the first character of the last line (to
be able to define the block). Note that 'selection'
applies, the position may be just after the Visual
area.''
``
'' `` To the position before the latest jump, or where the
last "m'" or "m`" command was given. Not set when the
:keepjumps command modifier was used.
Also see restore-position.'quote
`quote
'"" To the cursor position when last exiting the current
buffer. Defaults to the first character of the first
line. See last-position-jump for how to use this
for each opened file.
Only one position is remembered per buffer, not one
for each window. As long as the buffer is visible in
a window the position won't be changed. Mark is also
reset when :wshada is run.'^
`^
'^^ To the position where the cursor was the last time
when Insert mode was stopped. This is used by the
gi command. Not set when the :keepjumps command
modifier was used.'.
`.
'.. To the position where the last change was made. The
position is at or near where the change started.
Sometimes a command is executed as several changes,
then the position can be near the end of what the
command changed. For example when inserting a word,
the position will be on the last character.
To jump to older changes use g;.]'
]' [count] times to next line with a lowercase mark below
the cursor, on the first non-blank character in the
line.]`
]` [count] times to lowercase mark after the cursor.['
[' [count] times to previous line with a lowercase mark
before the cursor, on the first non-blank character in
the line.[`
[ [count] times to lowercase mark before the cursor.{command}
:loc
:lock
:lockmarks
Execute {command}
without adjusting marks. This is
useful when changing text in a way that the line count
will be the same when the change has completed.
WARNING: When the line count does change, marks below
the change will keep their line number, thus move to
another text line.
These items will not be adjusted for deleted/inserted
lines:
- line numbers in placed signs - line numbers in quickfix positions - positions in the |jumplist| - positions in the |tagstack| These items will still be adjusted: - previous context mark '' - the cursor position - the view of a window on a buffer - folds - diffs:kee[pmarks]
{command}
:kee
:keep
:keepmarks
Currently only has effect for the filter command
:range!:
:keepj
:keepjumps
:keepj[umps] {command}
Moving around in {command}
does not change the '',
'. and '^ marks, the jumplist or the
changelist.
Useful when making a change or inserting text
automatically and the user doesn't want to go to this
position. E.g., when updating a "Last change"
timestamp in the first line::let lnum = line(".") :keepjumps normal gg :call SetLastChange() :keepjumps exe "normal " .. lnum .. "G"
:keepjumps exe 'command '
the "command" won't keep
jumps. Instead use: :exe 'keepjumps command'
CTRL-O
CTRL-O Go to [count] Older cursor position in jump list
(not a motion command).<Tab>
or CTRL-I
<Tab>
CTRL-I Go to [count] newer cursor position in jump list
(not a motion command).CTRL-I
can be
mapped separately from <Tab>
, on the condition that
both keys are mapped, otherwise the mapping applies to
both. Except in tmux: https://github.com/tmux/tmux/issues/2705:cle
:clearjumps
:cle[arjumps] Clear the jump list of the current window.jumplist
Jumps are remembered in a jump list. With the CTRL-O
and CTRL-I
command you
can go to cursor positions before older jumps, and back again. Thus you can
move up and down the list. There is a separate jump list for each window.
The maximum number of entries is fixed at 100.jump line col file/text 3 1 0 some text 2 70 0 another line 1 1154 23 end. >
CTRL-O
command, the
cursor is put in line 1154. This results in:jump line col file/text 2 1 0 some text 1 70 0 another line > 0 1154 23 end. 1 1167 0 foo bar
CTRL-O
command will use the entry above it, the next CTRL-I
command will use the
entry below it. If the pointer is below the last entry, this indicates that
you did not use a CTRL-I
or CTRL-O
before. In this case the CTRL-O
command
will cause the cursor position to be added to the jump list, so you can get
back to the position before the CTRL-O
. In this case this is line 1167.CTRL-O
commands you will go to lines 70 and 1. If you use CTRL-I
you can go back to 1154 and 1167 again. Note that the number in the "jump"
column indicates the count for the CTRL-O
or CTRL-I
command that takes you to
this position.CTRL-O
you will get back to old positions
only once.CTRL-O
command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become:jump line col file/text 4 1 0 some text 3 70 0 another line 2 1167 0 foo bar 1 1154 23 end. >
jumplist-stack
When 'jumpoptions' option includes "stack", the jumplist behaves like the tag
stack. When jumping to a new location from the middle of the jumplist, the
locations after the current position will be discarded. With this option set
you can move through a tree of jump locations. When going back up a branch and
then down another branch, CTRL-O
still takes you further up the tree.CTRL-O
has been used to move back
three times to location X:jump line col file/text 2 1260 8 mark.c <-- location X-2 1 685 0 eval.c <-- location X-1 > 0 462 36 eval.c <-- location X 1 479 39 eval.c 2 213 2 mark.c 3 181 0 mark.c
jump line col file/text 3 1260 8 mark.c <-- location X-2 2 685 0 eval.c <-- location X-1 1 462 36 eval.c <-- location X >
jump line col file/text 4 1260 8 mark.c <-- location X-2 3 685 0 eval.c <-- location X-1 2 462 36 eval.c <-- location X 1 100 0 buffer.c <-- location Y >
g;
E662
g; Go to [count] older position in change list.
If [count] is larger than the number of older change
positions go to the oldest change.
If there is no older change an error message is given.
(not a motion command)g,
E663
g, Go to [count] newer position in change list.
Just like g; but in the opposite direction.
(not a motion command):keepjumps
command modifier is used the position of a change is not
remembered.:changes
:changes Print the change list. A ">" character indicates the
current position. Just after a change it is below the
newest entry, indicating that g;
takes you to the
newest entry position. The first column indicates the
count needed to take you to this position. Example:The `3g;` command takes you to line 9. Then the output of `:changes` is: change line col text ~ > 0 9 8 bla bla bla 1 11 57 foo is a bar 2 14 54 the latest changed line Now you can use "g," to go to line 11 and "2g," to go to line 14.
%
% Find the next item in this line after or under the
cursor and jump to its match. inclusive motion.
Items can be:
([{}]) parenthesis or (curly/square) brackets
(this can be changed with the
'matchpairs' option)
/* */
start or end of C-style comment
#if, #ifdef, #else, #elif, #endif
C preprocessor conditionals (when the
cursor is on the # or no ([{
is following)
For other items the matchit plugin can be used, see
matchit. This plugin also helps to skip matches in
comments.{count}
% jumps to a line {count}
percentage down the file N%. Using '%' on
#if/#else/#endif makes the movement linewise.[{
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.// 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]
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.