Nvim :help
pages, generated
from source
using the tree-sitter-vimdoc parser.
$XDG_CONFIG_HOME/nvim
instead of .vim
to store configuration files.
$XDG_STATE_HOME/nvim/shada/main.shada
instead of .viminfo
for persistent
session information. shada
:let loaded_matchit = 1
default-mouse
disable-mouse
By default the mouse is enabled, and <RightMouse>
opens a popup-menu with
standard actions ("Cut", "Copy", "Paste", …). Mouse is NOT enabled in
command-mode or the more-prompt, so you can temporarily disable it just by
typing ":".set mouse=
<RightMouse>
extends selection instead of showing popup-menu:
set mousemodel=extend
<A-LeftMouse>
releases mouse until the cursor moves:
nnoremap <A-LeftMouse> <Cmd>
\ set mouse=<Bar>
\ echo 'mouse OFF until next cursor-move'<Bar>
\ autocmd CursorMoved * ++once set mouse&<Bar>
\ echo 'mouse ON'<CR>
aunmenu PopUp.How-to\ disable\ mouse
aunmenu PopUp.-1-
default-mappings
Nvim creates the following default mappings at startup. You can disable any
of these in your config by simply removing the mapping, e.g. ":unmap Y".<C-U>
i_CTRL-U-default
<C-W>
i_CTRL-W-default
<C-L>
CTRL-L-default
default-autocmds
Default autocommands exist in the following groups. Use ":autocmd! {group}
" to
remove them and ":autocmd {group}
" to see how they're defined.feature-compile
-X
platform-specific
option is "sometimes" available in Vim (with potential surprises:
https://stackoverflow.com/q/14635295).
E5408
E5409
input(), inputdialog() support custom highlighting. input()-highlight
g:Nvim_color_cmdline
(Experimental) Command-line (:) is colored by callback defined in
g:Nvim_color_cmdline
(this callback is for testing only, and will be
removed in the future).{cmd}
directly (without 'shell')
matchadd() can be called before highlight group is defined
tempname() tries to recover if the Nvim tempdir disappears.
writefile() with "p" flag creates parent directories.<M-1>
, <M-BS>
, <M-Del>
, <M-Ins>
, <M-/>
, <M-\>
, <M-Space>
, <M-Enter>
, etc.
Case-sensitive: <M-a>
and <M-A>
are two different keycodes.$PATH
, :python and
:python3 are always available. See provider-python.'term'
E529
E530
E531
'term' reflects the terminal type derived from $TERM and other environment
checks. For debugging only; not reliable during startup.:echo &term
msgsep
'p'
(e.g. mkdir('/',
'p')) mkdir() will silently exit. In Vim this was an error.
3. mkdir() error messages now include strerror() text when mkdir fails.let l = []
echo [l, l]
%p
argument: in Vim
it used to return useless address of the string (strings are copied to the
newly allocated memory all over the place) and fail on types which cannot be
coerced to strings. See id() for more details, currently it uses
printf("%p", {expr})
internally.:lua print("a\0b")
will print a^@b
, like with :echomsg "a\nb"
. In Vim
that prints a
and b
on separate lines, exactly like
:lua print("a\nb")
.
:lua error('TEST')
emits the error:
E5108: Error executing lua: [string "<Vimscript compiled string>"]:1: TEST
vim.api
.
:write!
does not show a prompt if the file was updated externally.
:= does not accept ex-flags. With an arg it is equivalent to :lua=@
characters.
It is an error to define a highlight group with a name that doesn't match
the regexp [a-zA-Z0-9_.@-]*
(see group-name).<C-I>
) doesn't replace an
existing mapping for its simplified form (e.g. <Tab>
).
count
does not alias to v:count
errmsg
does not alias to v:errmsg
shell_error
does not alias to v:shell_error
this_session
does not alias to v:this_sessionE5000
E5001
E5002
getcwd(-1)
is equivalent to getcwd(-1, 0)
instead of returning the global
working directory. Use getcwd(-1, -1)
to get the global working directory.
hardcopy
:hardcopy
was removed. Instead, use :TOhtml
and print the
resulting HTML using a web browser or other HTML viewer.
:helpfind
:mode (no longer accepts an argument)
:open
:Print
:promptfind
:promptrepl
:scriptversion (always version 1)
:shell
:sleep! (does not hide the cursor; same as :sleep)
:smile
:tearoff
:cstag
:cscope
:lcscope
:scscope
:Vimuntarcscope
Cscope support was removed in favour of plugin-based solutions such as:
https://github.com/dhananjaylatkar/cscope_maps.nvimcscope_connection()
err_teapot()
js_encode()
js_decode()
v:none
(used by Vim to represent JavaScript "undefined"); use v:null instead.
v:sizeofint
v:sizeoflong
v:sizeofpointer
hl-StatusLineTerm
hl-StatusLineTermNC
are unnecessary because Nvim
supports 'winhighlight' window-local highlights.
For example, to mimic Vim's StatusLineTerm:hi StatusLineTerm ctermfg=black ctermbg=green
hi StatusLineTermNC ctermfg=green
autocmd TermOpen,WinEnter * if &buftype=='terminal'
\|setlocal winhighlight=StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC
\|else|setlocal winhighlight=|endif
'aleph'
'al'
antialias
'backspace' no longer supports number values. Instead:
backspace=0
set backspace=
(empty)
backspace=1
set backspace=indent,eol
backspace=2
set backspace=indent,eol,start
(default behavior in Nvim)
backspace=3
set backspace=indent,eol,nostop
'balloondelay'
'bdlay'
'ballooneval'
'beval'
'noballooneval'
'nobeval'
'balloonexpr'
'bexpr'
'backupdir': paths can no longer be separated with spaces.
bioskey (MS-DOS)
'cdpath': paths can no longer be separated with spaces.
conskey (MS-DOS)
'cp'
'nocompatible'
'nocp'
'compatible'
(Nvim is always "nocompatible".)
'cpoptions' (gjkHw<*- and all POSIX flags were removed)
'cryptmethod'
'cm'
'key'
(Vim encryption implementation)
cscopepathcomp
cscopeprg
cscopequickfix
cscoperelative
cscopetag
cscopetagorder
cscopeverbose
'ed'
'edcompatible'
'noed'
'noedcompatible'
'encoding' ("utf-8" is always used)
esckeys
'guioptions' "t" flag was removed
'guifontset'
'gfs'
(Use 'guifont' instead.)
'guipty'
(Nvim uses pipes and PTYs consistently on all platforms.)
'highlight' (Names of builtin highlight-groups cannot be changed.)
'hkmap'
'hk'
use set keymap=hebrew
instead.
'hkmapp'
'hkp'
use set keymap=hebrewp
instead.
keyprotocol
'pastetoggle'
'pt'
Just Paste It.™ paste is handled automatically when
you paste text using your terminal's or GUI's paste feature (CTRL-SHIFT-v
,
CMD-v (macOS), middle-click, …).'imactivatefunc'
'imaf'
'imactivatekey'
'imak'
'imstatusfunc'
'imsf'
'insertmode'
'im'
Use the following script to emulate 'insertmode':
autocmd BufWinEnter * startinsert
inoremap <Esc> <C-X><C-Z><C-]>
inoremap <C-C> <C-X><C-Z>
inoremap <C-L> <C-X><C-Z><C-]><Esc>
inoremap <C-Z> <C-X><C-Z><Cmd>suspend<CR>
noremap <C-C> <Esc>
snoremap <C-C> <Esc>
noremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR>
cnoremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR>
inoremap <C-\><C-G> <C-X><C-Z>
autocmd CmdWinEnter * noremap <buffer> <C-C> <C-C>
autocmd CmdWinEnter * inoremap <buffer> <C-C> <C-C>
lua << EOF
vim.on_key(function(c)
if c == '\27' then
local mode = vim.api.nvim_get_mode().mode
if mode:find('^[nvV\22sS\19]') and vim.fn.getcmdtype() == '' then
vim.schedule(function()
vim.cmd('startinsert')
end)
end
end
end)
EOF
'macatsui'
'maxcombine'
'mco'
Nvim always displays up to 6 combining characters. You can still edit
text with more than 6 combining characters, you just can't see them.
Use g8 or ga. See mbyte-combining.
'maxmem'
Nvim delegates memory-management to the OS.
'maxmemtot'
Nvim delegates memory-management to the OS.
'path': paths can no longer be separated with spaces.
printoptions
'printdevice'
'printencoding'
'printexpr'
'printfont'
'printheader'
'printmbcharset'
'prompt'
'noprompt'
'remap'
'noremap'
'restorescreen'
'rs'
'norestorescreen'
'nors'
'secure'
Everything is allowed in 'exrc' files since they must be explicitly marked
trusted.
'shelltype'
'shortname'
'sn'
'noshortname'
'nosn'
'swapsync'
'sws'
'termencoding'
'tenc'
(Vim 7.4.852 also removed this for Windows)
'terse'
'noterse'
(Add "s" to 'shortmess' instead)
textauto
textmode
'toolbar'
'tb'
'toolbariconsize'
'tbis'
'ttybuiltin'
'tbi'
'nottybuiltin'
'notbi'
'ttyfast'
'tf'
'nottyfast'
'notf'
'ttymouse'
'ttym'
'ttyscroll'
'tsl'
'ttytype'
'tty'
weirdinvertnvim +"n *"
)
Easy mode: eview, evim, nvim -y
Restricted mode: rview, rvim, nvim -Z
Vi mode: nvim -vt_xx
termcap-options
t_AB
t_Sb
t_vb
t_SI
Nvim does not have special t_XX
options nor <t_XX>
keycodes to configure
terminal capabilities. Instead Nvim treats the terminal as any other UI,
e.g. 'guicursor' sets the terminal cursor style if possible.xterm-8bit
xterm-8-bit
Xterm can be run in a mode where it uses true 8-bit CSI. Supporting this
requires autodetection of whether the terminal is in UTF-8 mode or non-UTF-8
mode, as the 8-bit CSI character has to be written differently in each case.
Vim issues a "request version" sequence to the terminal at startup and looks
at how the terminal is sending CSI. Nvim does not issue such a sequence and
always uses 7-bit control sequences.