interface (|lua.txt|):
- `: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: Lua: [string "<Vimscript compiled string>"]:1: TEST
< whereas Vim emits only "TEST".
- Lua has direct access to Nvim |API| via `vim.api`.
- Lua package.path and package.cpath are automatically updated according to
'runtimepath'. |lua-module-load|
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.
- |:=| does not accept |ex-flags|. With an arg it is equivalent to |:lua=|
Command-line:
- The meanings of arrow keys do not change depending on 'wildoptions'.
Functions:
- |input()| and |inputdialog()| support for each other’s 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-CursorLine| is low-priority unless foreground color is set
- |hl-VertSplit| superseded by |hl-WinSeparator|
- Highlight groups names are allowed to contain `@` 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|).
- |hl-StatusLineTerm| |hl-StatusLineTermNC| are implemented as 'winhighlight'
window-local highlights which are set by the default |TermOpen| handler.
- The |ins-completion-menu| has cascading highlight styles. |hl-PmenuSel| and
|hl-PmenuMatch| both inherit from |hl-Pmenu|, and |hl-PmenuMatchSel|
inherits highlights from both |hl-PmenuSel| and |hl-PmenuMatch|.
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>).
- "#" followed by a digit doesn't stand for a function key at the start of the
lhs of a mapping.
Motion:
- The |jumplist| avoids useless/phantom jumps.
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|
Vimscript compatibility:
- `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 after 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.
Options:
- 'titlestring' uses printf-style '%' items (see: 'statusline') to implement
the default behaviour. The implementation