neovim/runtime/doc/vim_diff.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

749 lines
27 KiB
Plaintext
Raw Normal View History

*vim_diff.txt* Nvim
NVIM REFERENCE MANUAL
Differences between Nvim and Vim *vim-differences*
2021-08-27 03:59:13 -07:00
Nvim differs from Vim in many ways, although editor and Vimscript (not
Vim9script) features are mostly identical. This document is a complete and
centralized reference of the differences.
Type |gO| to see the table of contents.
==============================================================================
1. Configuration *nvim-config*
2021-08-27 03:59:13 -07:00
- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for your |config|.
- Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files.
- Use `$XDG_STATE_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent
session information. |shada|
==============================================================================
2. Defaults *nvim-defaults*
- Filetype detection is enabled by default. This can be disabled by adding
":filetype off" to |init.vim|.
- Syntax highlighting is enabled by default. This can be disabled by adding
":syntax off" to |init.vim|.
- 'autoindent' is enabled
- 'autoread' is enabled
- 'background' defaults to "dark" (unless set automatically by the terminal/UI)
- 'backspace' defaults to "indent,eol,start"
- 'backupdir' defaults to .,~/.local/state/nvim/backup// (|xdg|), auto-created
- 'belloff' defaults to "all"
- 'compatible' is always disabled
- 'complete' excludes "i"
- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
- 'display' defaults to "lastline"
- 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding)
- 'fillchars' defaults (in effect) to "vert:│,fold:·,sep:│"
- 'formatoptions' defaults to "tcqj"
- 'fsync' is disabled
2021-08-17 11:12:09 -07:00
- 'hidden' is enabled
- 'history' defaults to 10000 (the maximum)
- 'hlsearch' is enabled
- 'incsearch' is enabled
2021-08-17 11:12:47 -07:00
- 'joinspaces' is disabled
- 'langnoremap' is enabled
- 'langremap' is disabled
2015-06-20 14:45:03 -07:00
- 'laststatus' defaults to 2 (statusline is always shown)
- 'listchars' defaults to "tab:> ,trail:-,nbsp:+"
- 'mouse' defaults to "nvi"
- 'mousemodel' defaults to "popup_setpos"
2016-02-15 11:55:51 -07:00
- 'nrformats' defaults to "bin,hex"
- 'ruler' is enabled
- 'sessionoptions' includes "unix,slash", excludes "options"
- 'shortmess' includes "F", excludes "S"
- 'showcmd' is enabled
2018-02-07 17:11:54 -07:00
- 'sidescroll' defaults to 1
- 'smarttab' is enabled
- 'startofline' is disabled
- 'switchbuf' defaults to "uselast"
- 'tabpagemax' defaults to 50
- 'tags' defaults to "./tags;,tags"
- 'ttimeoutlen' defaults to 50
- 'ttyfast' is always set
- 'undodir' defaults to ~/.local/state/nvim/undo// (|xdg|), auto-created
- 'viewoptions' includes "unix,slash", excludes "options"
- 'viminfo' includes "!"
- 'wildmenu' is enabled
- 'wildoptions' defaults to "pum,tagfile"
- |man.lua| plugin is enabled, so |:Man| is available by default.
- |matchit| plugin is enabled. To disable it in your config: >vim
:let loaded_matchit = 1
- |g:vimsyn_embed| defaults to "l" to enable Lua highlighting
Default Mouse ~
*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 ":".
If you don't like this you can disable the mouse in your |config| using any of
the following:
- Disable mouse completely by unsetting the 'mouse' option: >vim
set mouse=
- Pressing <RightMouse> extends selection instead of showing popup-menu: >vim
set mousemodel=extend
- Pressing <A-LeftMouse> releases mouse until the cursor moves: >vim
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>
<
To remove the "How-to disable mouse" menu item and the separator above it: >vim
aunmenu PopUp.How-to\ disable\ mouse
aunmenu PopUp.-1-
<
Default Mappings ~
*default-mappings*
2021-08-27 03:59:13 -07:00
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".
>vim
nnoremap Y y$
nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>
inoremap <C-U> <C-G>u<C-U>
inoremap <C-W> <C-G>u<C-W>
xnoremap * y/\V<C-R>"<CR>
xnoremap # y?\V<C-R>"<CR>
nnoremap & :&&<CR>
<
Default Autocommands ~
*default-autocmds*
Default autocommands exist in the following groups. Use ":autocmd! {group}" to
remove them and ":autocmd {group}" to see how they're defined.
nvim_terminal:
- BufReadCmd: Treats "term://" buffers as |terminal| buffers. |terminal-start|
nvim_cmdwin:
- CmdwinEnter: Limits syntax sync to maxlines=1 in the |cmdwin|.
==============================================================================
2016-06-15 18:33:47 -07:00
3. New Features *nvim-features*
MAJOR COMPONENTS
2016-06-15 18:33:47 -07:00
2017-08-19 05:13:14 -07:00
API |API|
2016-06-15 18:33:47 -07:00
Job control |job-control|
2021-08-27 03:59:13 -07:00
LSP framework |lsp|
Lua scripting |lua|
Parsing engine |treesitter|
2017-08-19 05:13:14 -07:00
Providers
Clipboard |provider-clipboard|
2018-06-12 00:18:25 -07:00
Node.js plugins |provider-nodejs|
2017-08-19 05:13:14 -07:00
Python plugins |provider-python|
Ruby plugins |provider-ruby|
2021-08-27 03:59:13 -07:00
Remote plugins |remote-plugin|
2017-08-19 05:13:14 -07:00
Shared data |shada|
2021-08-27 03:59:13 -07:00
Terminal emulator |terminal|
Vimscript parser |nvim_parse_expression()|
2017-08-19 05:13:14 -07:00
XDG base directories |xdg|
2016-06-15 18:33:47 -07:00
USER EXPERIENCE
2016-10-15 18:54:22 -07:00
2017-08-17 12:23:28 -07:00
Working intuitively and consistently is a major goal of Nvim.
2016-10-15 18:54:22 -07:00
2017-08-17 12:23:28 -07:00
*feature-compile*
- Nvim always includes ALL features, in contrast to Vim (which ships with
various combinations of 100+ optional features). Think of it as a leaner
version of Vim's "HUGE" build. This reduces surface area for bugs, and
removes a common source of confusion and friction for users.
- Nvim avoids features that cannot be provided on all platforms; instead that
is delegated to external plugins/extensions. E.g. the `-X` platform-specific
option is "sometimes" available in Vim (with potential surprises:
2022-10-14 08:01:13 -07:00
https://stackoverflow.com/q/14635295).
2017-07-28 15:28:41 -07:00
- Vim's internal test functions (test_autochdir(), test_settime(), etc.) are
not exposed (nor implemented); instead Nvim has a robust API.
2016-10-15 18:54:22 -07:00
2017-08-19 05:13:14 -07:00
- Behaviors, options, documentation are removed if they cost users more time
than they save.
Usability details have been improved where the benefit outweighs any
backwards-compatibility cost. Some examples:
- Directories for 'directory' and 'undodir' are auto-created.
- Terminal features such as 'guicursor' are enabled where possible.
Some features are built in that otherwise required external plugins:
- Highlighting the yanked region, see |lua-highlight|.
ARCHITECTURE
2016-06-15 18:33:47 -07:00
External plugins run in separate processes. |remote-plugin| This improves
2017-05-20 14:49:46 -07:00
stability and allows those plugins to work without blocking the editor. Even
"legacy" Python and Ruby plugins which use the old Vim interfaces (|if_pyth|,
2017-05-20 14:49:46 -07:00
|if_ruby|) run out-of-process.
2017-07-28 15:28:41 -07:00
Platform and I/O facilities are built upon libuv. Nvim benefits from libuv
features and bug fixes, and other projects benefit from improvements to libuv
by Nvim developers.
FEATURES
2016-06-15 18:33:47 -07:00
Command-line highlighting:
The expression prompt (|@=|, |c_CTRL-R_=|, |i_CTRL-R_=|) is highlighted
2021-08-27 03:59:13 -07:00
using a built-in Vimscript expression parser. |expr-highlight|
*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).
2016-06-15 18:33:47 -07:00
Commands:
|:checkhealth|
|:drop| is always available
|:Man| is available by default, with many improvements such as completion
|:match| can be invoked before highlight group is defined
|:source| works with Lua
User commands can support |:command-preview| to show results as you type
|:write| with "++p" flag creates parent directories.
2016-06-15 18:33:47 -07:00
Events:
|RecordingEnter|
|RecordingLeave|
|SearchWrapped|
|Signal|
2016-06-15 18:33:47 -07:00
|TabNewEntered|
|TermClose|
|TermOpen|
|UIEnter|
|UILeave|
Functions:
|dictwatcheradd()| notifies a callback whenever a |Dict| is modified
|dictwatcherdel()|
|menu_get()|
|msgpackdump()|, |msgpackparse()| provide msgpack de/serialization
|stdpath()|
|system()|, |systemlist()| can run {cmd} directly (without 'shell')
|matchadd()| can be called before highlight group is defined
|writefile()| with "p" flag creates parent directories.
2016-06-15 18:33:47 -07:00
Highlight groups:
2019-12-10 01:29:39 -07:00
|highlight-blend| controls blend level for a highlight group
|expr-highlight| highlight groups (prefixed with "Nvim")
|hl-NormalFloat| highlights floating window
2017-11-09 18:44:18 -07:00
|hl-NormalNC| highlights non-current windows
2019-08-25 16:00:52 -07:00
|hl-MsgArea| highlights messages/cmdline area
|hl-MsgSeparator| highlights separator for scrolled messages
|hl-Substitute|
2016-06-15 18:33:47 -07:00
|hl-TermCursor|
|hl-TermCursorNC|
|hl-WinSeparator| highlights window separators
|hl-Whitespace| highlights 'listchars' whitespace
Input/Mappings:
ALT (|META|) chords always work (even in the |TUI|). Map |<M-| with any key:
<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.
ALT may behave like <Esc> if not mapped. |i_ALT| |v_ALT| |c_ALT|
Normal commands:
|gO| shows a filetype-defined "outline" of the current buffer.
Options:
2019-12-10 02:24:20 -07:00
'cpoptions' flags: |cpo-_|
'guicursor' works in the terminal
'fillchars' flags: "msgsep", "horiz", "horizup",
"horizdown", "vertleft", "vertright", "verthoriz"
2020-03-01 08:43:18 -07:00
'foldcolumn' supports up to 9 dynamic/fixed columns
2019-12-10 02:24:20 -07:00
'inccommand' shows interactive results for |:substitute|-like commands
and |:command-preview| commands
'laststatus' global statusline support
'mousescroll' amount to scroll by when scrolling with a mouse
2019-12-10 02:24:20 -07:00
'pumblend' pseudo-transparent popupmenu
'scrollback'
2019-12-10 02:24:20 -07:00
'signcolumn' supports up to 9 dynamic/fixed columns
'statusline' supports unlimited alignment sections
'tabline' %@Func@foo%X can call any function on mouse-click
'winblend' pseudo-transparency in floating windows |api-floatwin|
'winhighlight' window-local highlights
2022-11-07 03:22:16 -07:00
'diffopt' has the option `linematch`.
signs: support multiple columns #9295 closes #990 closes #9295 - Support for multiple auto-adjusted sign columns. With this change, having more than one sign on a line, and with the 'auto' setting on 'signcolumn', extra columns will shown automatically to accomodate all the existing signs. For example, suppose we have this view: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } 5152 return 0; 5153 } 5154 We have GitGutter installed, so it tells us about modified lines that are not commmited. So let's change line 5152: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } ~ 5152 return 0; 5153 } 5154 Now we add a mark over line 5152 using 'ma' in normal mode: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } a ~ 5152 return 0; 5153 } 5154 Previously, Vim/Nvim would have picked only one of the signs, because there was no support for having multiple signs in a line. - Remove signs from deleted lines. Suppose we have highlights on a group of lines and we delete them: + 6 use std::ops::Deref; --+ 7 use std::borrow::Cow; --+ 8 use std::io::{Cursor}; 9 use proc_macro2::TokenStream; 10 use syn::export::ToTokens; --+ 11 use std::io::Write; >> 12 use std::ops::Deref; Without this change, these signs will momentarily accumulate in the sign column until the plugins wake up to refresh them. + --+ --+ --+ >> 6 Discussion: It may be better to extend the API a bit and allow this to happen for only certain types of signs. For example, VIM marks and vim-gitgutter removal signs may want to be presreved, unlike line additions and linter highlights. - 'signcolumn': support 'auto:NUM' and 'yes:NUM' settings - sort signs according to id, from lowest to highest. If you have git-gutter, vim-signature, and ALE, it would appear in this order: git-gutter - vim-signature - ALE. - recalculate size before screen update - If no space for all signs, prefer the higher ids (while keeping the rendering order from low to high). - Prevent duplicate signs. Duplicate signs were invisible to the user, before using our extended non-standard signcolumn settings. - multi signcols: fix bug related to wrapped lines. In wrapped lines, the wrapped parts of a line did not include the extra columns if they existed. The result was a misdrawing of the wrapped parts. Fix the issue by: 1. initializing the signcol counter to 0 when we are on a wrap boundary 2. allowing for the draw of spaces in that case.
2019-03-24 18:16:58 -07:00
Signs:
Signs are removed if the associated line is deleted.
Variables:
|v:progpath| is always absolute ("full")
|v:windowid| is always available (for use by external UIs)
2017-07-26 02:31:01 -07:00
2016-06-15 18:33:47 -07:00
==============================================================================
4. Upstreamed features *nvim-upstreamed*
These Nvim features were later integrated into Vim.
- 'fillchars' flags: "eob"
- 'wildoptions' flags: "pum" enables popupmenu for wildmode completion
- |<Cmd>|
- |WinClosed|
- |WinScrolled|
- |:sign-define| "numhl" argument
- |:source| works with anonymous (no file) scripts
==============================================================================
5. Changed features *nvim-features-changed*
Nvim always builds with all features, in contrast to Vim which may have
certain features removed/added at compile-time. |feature-compile|
Some Vim features were changed in Nvim, and vice versa.
If a Python interpreter is available on your `$PATH`, |:python| and |:python3|
are always available and may be used simultaneously. See |provider-python|.
2017-08-15 15:20:37 -07:00
|:redir| nested in |execute()| works.
2015-07-18 02:23:42 -07:00
|mkdir()| behaviour changed:
2016-04-07 18:36:14 -07:00
1. Assuming /tmp/foo does not exist and /tmp can be written to
2015-07-18 02:23:42 -07:00
mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and /tmp/foo/bar
with 0700 permissions. Vim mkdir will create /tmp/foo with 0755.
2016-04-07 18:36:14 -07:00
2. If you try to create an existing directory with `'p'` (e.g. mkdir('/',
2015-07-18 02:23:42 -07:00
'p')) mkdir() will silently exit. In Vim this was an error.
3. mkdir() error messages now include strerror() text when mkdir fails.
|string()| and |:echo| behaviour changed:
2016-04-07 18:36:14 -07:00
1. No maximum recursion depth limit is applied to nested container
structures.
2016-04-07 18:36:14 -07:00
2. |string()| fails immediately on nested containers, not when recursion limit
was exceeded.
2. When |:echo| encounters duplicate containers like >vim
let l = []
echo [l, l]
<
2016-04-07 18:36:14 -07:00
it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is
only used for recursive containers.
2016-04-07 18:36:14 -07:00
3. |:echo| printing nested containers adds "@level" after "..." designating
the level at which recursive container was printed: |:echo-self-refer|.
Same thing applies to |string()| (though it uses construct like
"{E724@level}"), but this is not reliable because |string()| continues to
error out.
2016-04-07 18:36:14 -07:00
4. Stringifyed infinite and NaN values now use |str2float()| and can be evaled
back.
5. (internal) Trying to print or stringify VAR_UNKNOWN in Vim results in
nothing, E908, in Nvim it is internal error.
2016-02-13 11:39:28 -07:00
|json_decode()| behaviour changed:
2016-02-01 11:22:07 -07:00
1. It may output |msgpack-special-dict|.
2016-02-13 11:39:28 -07:00
2. |msgpack-special-dict| is emitted also in case of duplicate keys, while in
Vim it errors out.
3. It accepts only valid JSON. Trailing commas are not accepted.
2016-02-01 11:22:07 -07:00
2016-02-13 11:39:28 -07:00
|json_encode()| behaviour slightly changed: now |msgpack-special-dict| values
are accepted, but |v:none| is not.
2016-04-07 18:36:14 -07:00
Viminfo text files were replaced with binary (messagepack) ShaDa files.
2015-07-05 04:08:50 -07:00
Additional differences:
- |shada-c| has no effect.
- |shada-s| now limits size of every item and not just registers.
2016-04-07 18:36:14 -07:00
- 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for
compatibility reasons.
2016-04-07 18:36:14 -07:00
- |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old
commands are still kept.
2016-04-07 18:36:14 -07:00
- ShaDa file format was designed with forward and backward compatibility in
mind. |shada-compatibility|
2016-04-07 18:36:14 -07:00
- Some errors make ShaDa code keep temporary file in-place for user to decide
what to do with it. Vim deletes temporary file in these cases.
|shada-error-handling|
- ShaDa file keeps search direction (|v:searchforward|), viminfo does not.
2015-07-05 04:08:50 -07:00
|printf()| returns something meaningful when used with `%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.
|c_CTRL-R| pasting a non-special register into |cmdline| omits the last <CR>.
|CursorMoved| always triggers when moving between windows.
Lua interface (|lua.txt|):
2017-01-29 12:07:24 -07:00
- `:lua print("a\0b")` will print `a^@b`, like with `:echomsg "a\nb"` . In Vim
2017-01-29 12:07:24 -07:00
that prints `a` and `b` on separate lines, exactly like
`:lua print("a\nb")` .
- `:lua error('TEST')` emits the error “E5105: Error while calling lua chunk:
[string "<VimL compiled string>"]:1: TEST”, whereas Vim emits only “TEST”.
2017-05-11 08:45:11 -07:00
- Lua has direct access to Nvim |API| via `vim.api`.
- Lua package.path and package.cpath are automatically updated according to
'runtimepath': |lua-require|.
2017-01-29 12:07:24 -07:00
Commands:
|:doautocmd| does not warn about "No matching autocommands".
|:wincmd| accepts a count.
`:write!` does not show a prompt if the file was updated externally.
Command line completion:
The meanings of arrow keys do not change depending on 'wildoptions'.
Functions:
|input()| and |inputdialog()| support for each others features (return on
cancel and completion respectively) via dictionary argument (replaces all
other arguments if used), and "cancelreturn" can have any type if passed in
a dictionary.
|input()| and |inputdialog()| support user-defined cmdline highlighting.
Highlight groups:
|hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other
groups
|hl-CurSearch| highlights match under cursor instead of last match found
using |n| or |N|
|hl-CursorLine| is low-priority unless foreground color is set
|hl-VertSplit| superseded by |hl-WinSeparator|
Highlight groups names are allowed to contain the characters `.` and `@`.
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|).
Macro/|recording| behavior
Replay of a macro recorded during :lmap produces the same actions as when it
was recorded. In Vim if a macro is recorded while using :lmap'ped keys then
the behaviour during record and replay differs.
'keymap' is implemented via :lmap instead of :lnoremap so that you can use
macros and 'keymap' at the same time. This also means you can use |:imap| on
the results of keys from 'keymap'.
Mappings:
Creating a mapping for a simplifiable key (e.g. <C-I>) doesn't replace an
existing mapping for its simplified form (e.g. <Tab>).
Motion:
The |jumplist| avoids useless/phantom jumps.
Normal commands:
|Q| replays the last recorded macro instead of switching to Ex mode.
Instead |gQ| can be used to enter Ex mode.
Options:
'ttimeout', 'ttimeoutlen' behavior was simplified
'jumpoptions' "stack" behavior
'jumpoptions' "view" tries to restore the |mark-view| when moving through
feat(marks): restore viewport on jump #15831 ** Refactor Previously most functions used to "get" a mark returned a position, changed the line number and sometimes changed even the current buffer. Now functions return a {x}fmark_T making calling context aware whether the mark is in another buffer without arcane casting. A new function is provided for switching to the mark buffer and returning a flag style Enum to convey what happen in the movement. If the cursor changed, line, columns, if it changed buffer, etc. The function to get named mark was split into multiple functions. - mark_get() -> fmark_T - mark_get_global() -> xfmark_T - mark_get_local() -> fmark_T - mark_get_motion() -> fmark_T - mark_get_visual() -> fmark_T Functions that manage the changelist and jumplist were also modified to return mark types. - get_jumplist -> fmark_T - get_changelist -> fmark_T The refactor is also seen mainly on normal.c, where all the mark movement has been siphoned through one function nv_gomark, while the other functions handle getting the mark and setting their movement flags. To handle whether context marks should be left, etc. ** Mark View While doing the refactor the concept of a mark view was also implemented: The view of a mark currently implemented as the number of lines between the mark position on creation and the window topline. This allows for moving not only back to the position of a mark but having the window look similar to when the mark was defined. This is done by carrying and extra element in the fmark_T struct, which can be extended later to also restore horizontal shift. *** User space features 1. There's a new option, jumpoptions+=view enables the mark view restoring automatically when using the jumplist, changelist, alternate-file and mark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark] ** Limitations - The view information is not saved in shada. - Calls to get_mark should copy the value in the pointer since we are using pos_to_mark() to wrap and provide a homogeneous interfaces. This was also a limitation in the previous state of things.
2022-06-30 05:59:52 -07:00
the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|.
'shortmess' the "F" flag does not affect output from autocommands
2022-12-19 09:33:47 -07:00
'exrc' searches for ".nvim.lua", ".nvimrc", or ".exrc" files. The user is
prompted whether to trust the file.
Shell:
Shell output (|:!|, |:make|, …) is always routed through the UI, so it
cannot "mess up" the screen. (You can still use "chansend(v:stderr,…)" if
you want to mess up the screen :)
Nvim throttles (skips) messages from shell commands (|:!|, |:grep|, |:make|)
if there is too much output. No data is lost, this only affects display and
improves performance. |:terminal| output is never throttled.
|:!| does not support "interactive" commands. Use |:terminal| instead.
(GUI Vim has a similar limitation, see ":help gui-pty" in Vim.)
:!start is not special-cased on Windows.
|system()| does not support writing/reading "backgrounded" commands. |E5677|
Startup:
|-e| and |-es| invoke the same "improved Ex mode" as -E and -Es.
|-E| and |-Es| read stdin as text (into buffer 1).
|-es| and |-Es| have improved behavior:
- Quits automatically, don't need "-c qa!".
- Skips swap-file dialog.
|-s| reads Normal commands from stdin if the script name is "-".
Reading text (instead of commands) from stdin |--|:
- works by default: "-" file is optional
- works in more cases: |-Es|, file args
Syntax highlighting:
syncolor.vim has been removed. Nvim now sets up default highlighting groups
automatically for both light and dark backgrounds, regardless of whether or
not syntax highlighting is enabled. This means that |:syntax-on| and
|:syntax-enable| are now identical. Users who previously used an
after/syntax/syncolor.vim file should transition that file into a
colorscheme. |:colorscheme|
TUI:
*:set-termcap*
Start Nvim with 'verbose' level 3 to show terminal capabilities: >
nvim -V3
<
*'term'* *E529* *E530* *E531*
'term' reflects the terminal type derived from |$TERM| and other environment
checks. For debugging only; not reliable during startup. >vim
:echo &term
< "builtin_x" means one of the |builtin-terms| was chosen, because the expected
terminfo file was not found on the system.
Nvim will use 256-colour capability on Linux virtual terminals. Vim uses
only 8 colours plus bright foreground on Linux VTs.
Vim combines what is in its |builtin-terms| with what it reads from terminfo,
and has a 'ttybuiltin' setting to control how that combination works. Nvim
uses one or the other, it does not attempt to merge the two.
UI/Display:
|Visual| selection highlights the character at cursor. |visual-use|
messages: When showing messages longer than 'cmdheight', only
scroll the message lines, not the entire screen. The
separator line is decorated by |hl-MsgSeparator| and
the "msgsep" flag of 'fillchars'. *msgsep*
2021-08-27 03:59:13 -07:00
Vimscript compatibility:
2017-11-14 02:47:49 -07:00
`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_session|
Working directory (Vim implemented some of these later than Nvim):
- |DirChanged| and |DirChangedPre| can be triggered when switching to another
window or tab.
- |getcwd()| and |haslocaldir()| may throw errors if the tab page or window
cannot be found. *E5000* *E5001* *E5002*
- |haslocaldir()| checks for tab-local directory if and only if -1 is passed as
window number, and its only possible returns values are 0 and 1.
- `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.
==============================================================================
6. Missing legacy features *nvim-features-missing*
Some legacy Vim features are not yet implemented:
- *if_lua* : Nvim |Lua| API is not compatible with Vim's "if_lua"
2017-05-11 08:45:11 -07:00
- *if_mzscheme*
- |if_pyth|: *python-bindeval* *python-Function* are not supported
2017-05-11 08:45:11 -07:00
- *if_tcl*
*:gui*
*:gvim*
==============================================================================
7. Removed features *nvim-features-removed*
2017-08-17 12:23:28 -07:00
These Vim features were intentionally removed from Nvim.
Aliases:
ex (alias for "nvim -e")
exim (alias for "nvim -E")
gex (GUI)
gview (GUI)
gvim (GUI)
gvimdiff (GUI)
rgview (GUI)
rgvim (GUI)
rview
rvim
view (alias for "nvim -R")
vimdiff (alias for "nvim -d" |diff-mode|)
Commands:
:fixdel
:hardcopy
: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
2022-10-08 07:48:07 -07:00
:cstag
:cscope
:lcscope
:scscope
Compile-time features:
Emacs tags support
X11 integration (see |x11-selection|)
2020-01-13 00:41:55 -07:00
Eval:
Vim9script
2022-10-08 07:48:07 -07:00
*cscope_connection()*
2020-01-13 00:41:55 -07:00
*js_encode()*
*js_decode()*
*v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead.
*v:sizeofint*
*v:sizeoflong*
*v:sizeofpointer*
2020-01-13 00:41:55 -07:00
Events:
*SigUSR1* Use |Signal| to detect `SIGUSR1` signal instead.
Highlight groups:
*hl-StatusLineTerm* *hl-StatusLineTermNC* are unnecessary because Nvim
supports 'winhighlight' window-local highlights.
For example, to mimic Vim's StatusLineTerm: >vim
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
<
Options:
antialias
*'balloondelay'* *'bdlay'*
*'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
*'balloonexpr'* *'bexpr'*
bioskey (MS-DOS)
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)
2022-10-08 07:48:07 -07:00
cscopepathcomp
cscopeprg
cscopequickfix
cscoperelative
cscopetag
cscopetagorder
cscopeverbose
*'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
2016-01-27 04:20:44 -07:00
'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.)
*'imactivatefunc'* *'imaf'*
*'imactivatekey'* *'imak'*
*'imstatusfunc'* *'imsf'*
*'insertmode'* *'im'* Use the following script to emulate 'insertmode':
>vim
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.
*'printdevice'*
*'printencoding'*
*'printexpr'*
*'printfont'*
*'printheader'*
*'printmbcharset'*
2021-07-23 09:06:01 -07:00
*'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'*
weirdinvert
Performance:
Folds are not updated during insert-mode.
Startup:
--literal (file args are always literal; to expand wildcards on Windows, use
|:n| e.g. `nvim +"n *"`)
Easy mode: eview, evim, nvim -y
Restricted mode: rview, rvim, nvim -Z
Vi mode: nvim -v
Test functions:
test_alloc_fail()
test_autochdir()
test_disable_char_avail()
test_feedinput()
test_garbagecollect_soon
test_getvalue()
test_ignore_error()
test_null_blob()
test_null_channel()
test_null_dict()
test_null_function()
test_null_job()
test_null_list()
test_null_partial()
test_null_string()
test_option_not_set()
test_override()
test_refcount()
test_scrollbar()
test_setmouse()
test_settime()
test_srand_seed()
TUI:
*t_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.
*termcap*
Nvim never uses the termcap database, only |terminfo| and |builtin-terms|.
*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.
2022-10-08 07:48:07 -07:00
Cscope:
*cscope*
2022-10-20 03:04:32 -07:00
Cscope support has been removed in favour of LSP based solutions.
2022-10-08 07:48:07 -07:00
Hardcopy:
*hardcopy*
`:hardcopy` was removed. Instead, use `:TOhtml` and print the resulting HTML
using a web browser or some other HTML viewer.
==============================================================================
vim:tw=78:ts=8:sw=2:et:ft=help:norl: