Home Explore Blog CI



neovim

4th chunk of `runtime/doc/vim_diff.txt`
11a3c73c5c79b3ce1fca05b6aeb936ccc9028781da6e214b0000000100000fa2
                          |API|
- Job control                     |job-control|
- LSP framework                   |lsp|
- Lua scripting                   |lua|
- Parsing engine                  |treesitter|
- Providers
  - Clipboard                     |provider-clipboard|
  - Node.js plugins               |provider-nodejs|
  - Python plugins                |provider-python|
  - Ruby plugins                  |provider-ruby|
- Remote plugins                  |remote-plugin|
- Shared data                     |shada|
- Terminal emulator               |terminal|
- UI                              |ui| |--listen| |--server|
- Vimscript parser                |nvim_parse_expression()|
- XDG base directories            |xdg|

USER EXPERIENCE

Working intuitively and consistently is a major goal of Nvim.

                                                        *feature-compile*
- Nvim always includes ALL features, in contrast to Vim (which ships various
  combinations of 100+ optional features).  |feature-compile| 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:
  https://stackoverflow.com/q/14635295).

- Vim's internal test functions (test_autochdir(), test_settime(), etc.) are
  not exposed (nor implemented); instead Nvim has a robust API.

- 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.
- Various "nvim" |cli-arguments| were redesigned.

Some features are built in that otherwise required external plugins:

- Highlighting the yanked region, see |vim.hl|.

ARCHITECTURE

The Nvim UI is "decoupled" from the core editor: all UIs, including the
builtin |TUI| are just plugins that connect to a Nvim server (via |--server|
or |--embed|). Multiple Nvim UI clients can connect to the same Nvim editor
server.

External plugins run in separate processes. |remote-plugin| This improves
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|,
|if_ruby|) run out-of-process, so they cannot crash Nvim.

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

Command-line:
- The expression prompt (|@=|, |c_CTRL-R_=|, |i_CTRL-R_=|) is highlighted
  using a built-in Vimscript expression parser. |expr-highlight|
- *E5408* *E5409* |input()|, |inputdialog()| support custom highlighting.
  |input()-highlight|
- (Experimental) *g:Nvim_color_cmdline* 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).

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.

Events (autocommands):
- Fixed inconsistent behavior in execution of nested autocommands #23368
- |RecordingEnter|
- |RecordingLeave|
- |SearchWrapped|
- |Signal|
- |TabNewEntered|
- |TermClose|
- |TermOpen|
- |TermResponse| is fired for any OSC sequence received from the terminal,
  instead of the Primary Device Attributes response. |v:termresponse|
- |UIEnter|
- |UILeave|

Functions:

Title: Nvim Features: User Experience, Architecture, and Commands
Summary
This section details Nvim's features, including its commitment to user experience through consistent behavior and the inclusion of all features by default. It discusses how Nvim avoids platform-specific features, uses a robust API, and removes redundant behaviors. The architecture section describes the decoupled UI, external plugins running in separate processes, and the use of libuv. It also lists command-line enhancements, commands like :checkhealth, :drop, :Man, and :match, and the available autocommands like RecordingEnter, RecordingLeave, SearchWrapped, Signal, TabNewEntered, TermClose, TermOpen, TermResponse, UIEnter, and UILeave.