Vim vs Neovim: what's different, and which to use
Neovim is a 2014 fork of Vim. It keeps Vim's modes and keys but adds a Lua configuration (init.lua), a built-in LSP client, Tree-sitter parsing and more modern defaults. Vim is the original, with its own new language, Vim9 script, and it is more likely to be installed already. Every motion, operator and text object works the same in both, so what you learn in one carries straight over.
| Vim | Neovim | |
|---|---|---|
| Origin | The original "Vi IMproved"; Vim 9.x is current | Forked from Vim in 2014; "a continuation and extension of Vim", in its own words |
| Command | vim | nvim |
| Config file | ~/.vimrc (or ~/.vim/vimrc) | init.lua or init.vim (not both) in stdpath('config'), usually ~/.config/nvim |
| Scripting | Legacy Vimscript and Vim9 script | Lua and legacy Vimscript; Vim9 script is not supported |
| Language servers (LSP) | No built-in client; an lsp channel mode helps plugins provide one | Built-in client (vim.lsp); you install the servers |
| Syntax highlighting | Regex-based syntax files | Tree-sitter built in, plus the same syntax files |
| Terminal in a window | :terminal, in builds with +terminal | :terminal, always built in |
| Overlays | Popup windows | Floating windows (Vim's popup windows were removed) |
| Defaults | Conservative, close to vi; defaults.vim adds a few when you have no vimrc | hlsearch, incsearch, autoindent, hidden, status line always on, mouse on, filetype and syntax on |
| Motions, operators, text objects | Same | Same |
Where Neovim came from
Neovim was started in 2014 by Thiago de Arruda, after a patch that would have added multi-threading to Vim was turned down, and it was funded by a public fundraiser that March. Its charter calls it "not a rewrite but a continuation and extension of Vim", with goals that include keeping Vim's character ("fast, versatile, quasi-minimal") and offering a first-class Lua interface as an alternative to Vimscript.
Vim did not stand still. Vim 9.0 (June 2022) introduced Vim9 script, a faster, stricter dialect of Vimscript. Bram Moolenaar, Vim's lead developer for more than 30 years, died in 2023, and Vim 9.1 was dedicated to him; the Vim project has carried on releasing since. Both editors are maintained today, and neither is a drop-in replacement for the other.
Configuration: Vimscript, Vim9 script and Lua
This is the difference you feel first. Vim reads ~/.vimrc, written in Vimscript. Since 9.0 you can also write vim9script files, where functions are declared with def and variables with var; the Vim project expects them to run 10 to 100 times faster than legacy script, and says legacy script will keep working.
Neovim reads init.lua or init.vim from its config folder (:echo stdpath('config') shows where), but not both at once. You can still call Vimscript from Lua and Lua from Vimscript, so it is not all-or-nothing. Neovim's charter lists supporting Vim9 script as a non-goal, so a plugin or config written in Vim9 script will not run there.
If you are moving from Vim, Neovim's own help (:h nvim-from-vim) gives three lines for init.vim that load your existing ~/.vimrc:
set runtimepath^=~/.vim runtimepath+=~/.vim/afterlet &packpath = &runtimepathsource ~/.vimrc
Most set lines and mappings carry over. A few options were removed in Neovim, so the help suggests guarding those with if !has('nvim').
What Neovim builds in
A language server client. Neovim speaks the Language Server Protocol itself: vim.lsp.config() describes a server and vim.lsp.enable() turns it on, and it comes with default mappings such as K for hover documentation and grn to rename. The servers themselves (for TypeScript, Python, Rust and so on) are separate programs you install. Vim has an lsp mode for its channels, which handles the protocol's encoding, but the client itself comes from a plugin you choose.
Tree-sitter. Neovim includes the Tree-sitter parsing library, which builds a syntax tree of the file. Plugins and your config use it for more precise highlighting, folding and code-aware selections. Vim highlights with its long-standing regex-based syntax files, which Neovim also still ships.
A Lua API and floating windows. Most modern Neovim plugins are written in Lua against Neovim's API, and draw completion menus and pop-ups in floating windows. Vim has its own popup windows for the same job; Neovim removed those in favour of floating windows, which is one reason UI plugins rarely work in both.
Both have :terminal for a shell in a split, and both have jobs and channels for asynchronous work.
Defaults that differ
Start each editor with no config and they feel different, mostly because Neovim changed defaults that most people set by hand anyway. Neovim's :h vim-differences lists them all; the ones you notice first:
- Search highlights its matches (
hlsearch) and jumps as you type (incsearch). - New lines keep the indent of the line above (
autoindent). - The status line is always shown (
laststatus=2) and the mouse works in Normal, Visual and Insert mode (mouse=nvi). - You can switch away from a changed buffer without saving it first (
hidden). - Filetype detection and syntax highlighting are on, and
'compatible'is always off. - Undo history and session data (ShaDa, which replaces
.viminfo) live in standard folders such as~/.local/state/nvim.
None of this changes what a key does. dw deletes a word, ci" changes inside quotes and . repeats the last change, in both.
The one default that changes a key
Most of Neovim's new defaults are options, but one changes what a key does: Y. This editor follows Vim.
In Vim, with the cursor on price, you press Y and then P. What happens?
Plugins and stability
Plugins written in plain Vimscript usually work in both editors. Plugins written in Lua need Neovim, and plugins written in Vim9 script need Vim. Over the last several years much of the new plugin work, especially around language servers, fuzzy finding and Tree-sitter, has been Lua for Neovim, while Vim's ecosystem leans on long-lived Vimscript plugins.
Vim changes slowly and carefully, and a vimrc from years ago generally still works. Neovim moves faster: it adds features and occasionally deprecates or changes APIs between releases, so a Neovim config with many plugins takes some upkeep. Whether that is a cost or the point depends on you.
The part that is the same
Modes, motions, operators, counts, text objects, registers, macros, marks, :s and :g are the same in both editors, because Neovim kept Vim's editing model on purpose. A habit like ciw or qa ... q @a works identically, so the choice of editor doesn't change what you have to learn. You can practise the motions in a browser at the course, then set up whichever editor you picked; the Neovim config lesson covers a first init.lua.
Same keys, either editor
This is an init.lua, but the keys would be identical in a vimrc, in Vim or in Neovim. Change the first 2 to 4 with ciw, then repeat it on the next two lines: j and $ to reach the value, . to repeat the change.
This editor needs a keyboard. Read on, and play it at your computer.
Which should you pick?
- You want an IDE-like setup in the terminal: completion, go-to-definition, diagnostics Neovim. The LSP client and Tree-sitter are built in, and most current plugins for this target Neovim.
- You edit files on servers you don't control Vim, or plain vi. It is far more likely to be installed already, and your motions work the same.
- You have a long vimrc, or plugins written in Vim9 script Stay with Vim. Neovim does not run Vim9 script, and there is nothing to gain from rewriting a config that works.
- You would rather configure in a general-purpose language Neovim, with an
init.lua. - You only want Vim keys inside VS Code Either is fine to learn on. The vscode-neovim extension needs Neovim installed; VSCodeVim needs neither.
Questions
- Can Neovim use my .vimrc?
- Yes, mostly. Put
source ~/.vimrcininit.vimalong with the two runtimepath lines from:h nvim-from-vim. Options Neovim removed, and anything in Vim9 script, will need changes. - Are Vim keybindings different in Neovim?
- No. Motions, operators, text objects, macros and Ex commands are the same. Neovim adds a few default mappings (such as grn for an LSP rename), but the core editing keys are unchanged.
- Is Neovim replacing Vim?
- No. Both are actively developed. Vim released 9.1 in January 2024 and has continued since; Neovim releases on its own schedule.