Home

vnoremap

vnoremap is a Vim command that creates non-recursive mappings for visual mode. It defines key sequences that apply when text is selected, making it the non-recursive counterpart to the visual-mode mapping command. By using a non-recursive mapping, the right-hand side is interpreted literally and will not be expanded through other mappings.

Syntax and options: The basic form is :vnoremap {lhs} {rhs}. You can precede {lhs} with options such

Behavior and purpose: vnoremap ensures that mappings defined for visual mode do not recursively reuse other

Examples:

- Yanking to the system clipboard in visual mode: :vnoremap <leader>y "+y. With a visual selection, pressing

- A silent, buffer-local mapping: :vnoremap <silent> <buffer> <leader>p "_dP. This demonstrates option usage and scope, though

Relation to other mappings: vnoremap is part of Vim’s set of mode-specific mappings and is complemented by

as
<silent>,
<expr>,
<buffer>,
or
<nowait>
(for
example,
:vnoremap
<silent>
<leader>y
"+y).
The
left-hand
side
{lhs}
is
the
keys
you
press
in
visual
mode
after
making
a
selection,
and
the
right-hand
side
{rhs}
is
the
command
or
keystrokes
that
will
be
executed.
mappings
when
executed.
This
helps
prevent
unexpected
interactions
between
mappings
and
is
commonly
used
to
tailor
actions
on
the
selected
text,
such
as
yanking,
replacing,
or
transforming
the
selection.
the
mapped
keys
yanks
the
selection
into
the
system
clipboard.
the
exact
RHS
depends
on
the
desired
behavior.
related
commands
such
as
nmap,
nnoremap,
vmap,
and
xnoremap.
It
is
particularly
useful
when
you
want
stable,
non-recursive
behavior
tied
to
visual
selections.