Home

nnoremap

nnoremap is a Vim and Neovim command used to create non-recursive mappings for normal mode. It assigns a left-hand side sequence of keys to a right-hand side action without allowing the right-hand side to be remapped by other mappings. This ensures predictable behavior and prevents accidental recursion if the RHS happens to be mapped elsewhere.

Syntax and scope: The basic form is nnoremap lhs rhs. The lhs is the key sequence pressed

Comparison and related mappings: nnoremap is the normal-mode counterpart of the broader noremap family. There are

Best practices: Use non-recursive mappings for user-defined shortcuts and plugin integrations to keep mappings stable. Prefer

Examples:

- nnoremap <leader>w :w<CR>

- nnoremap <leader>q :q!<CR>

- nnoremap <silent> <leader>p <Plug>MyPluginDoSomething

Overall, nnoremap provides safe, predictable normal-mode key remapping suitable for both personal workflow customization and plugin

in
normal
mode,
and
the
rhs
is
what
gets
executed.
The
right-hand
side
can
include
commands,
keystrokes,
or
special
keys
such
as
<CR>
or
<Esc>.
It
can
also
use
<expr>
in
the
rhs
to
treat
the
mapping
as
an
expression
that
is
evaluated
when
invoked.
Options
like
<silent>
or
<nowait>
can
be
added
to
refine
behavior.
For
example:
nnoremap
<leader>w
:w<CR>
saves
the
current
buffer.
analogous
non-recursive
mappings
for
other
modes,
such
as
vnoremap
for
visual
mode
and
inoremap
for
insert
mode.
By
contrast,
nmap
(without
nore)
is
recursive,
meaning
the
RHS
can
be
remapped
if
it
contains
other
mapped
sequences.
This
distinction
helps
avoid
unintended
interactions
with
existing
mappings
and
plugins.
<Plug>
mappings
as
an
abstraction
layer
when
exposing
plugin
functionality,
and
keep
the
RHS
as
short
and
robust
as
possible.
compatibility.