Neovim Basics: Getting From Vim to a Modern Editor Setup
Neovim is a fork of Vim that has become the default choice for people who want Vim’s editing model with a modern setup around it: configuration in Lua, a built-in client for language servers, and accurate syntax highlighting from real parsers.
If modal editing itself is new to you, start with our Vim basics for beginners. Everything there works in Neovim unchanged: i to insert, Esc to return to normal mode, :w to save, dd, yy, p, ciw, and the rest.
What Neovim adds
| Feature | Vim | Neovim |
|---|---|---|
| Modal editing, motions, text objects | Yes | Same |
| Config language | Vimscript (and Vim9 script) | Lua and Vimscript |
| Language server client | Via plugins | Built in |
| Syntax highlighting | Regex-based | Regex, plus Tree-sitter parsers |
| Terminal inside the editor | Yes | Yes |
| Async jobs and remote UIs | Added later | Designed in |
| Sensible defaults | Minimal | More modern defaults out of the box |
The two that matter most day to day are LSP and Tree-sitter.
LSP (Language Server Protocol) lets an editor ask a separate language server about your code: where is this function defined, what are its references, what errors are in this file, what can I complete here. The same servers power VS Code. Neovim ships the client; you install servers for the languages you use.
Tree-sitter parses your file into a real syntax tree instead of guessing with regular expressions. Highlighting becomes accurate, and you get structural features such as selecting “this function” or “this argument.”
Installing
sudo apt install neovim # Debian / Ubuntu (can be old on LTS releases)
sudo dnf install neovim # Fedora
sudo pacman -S neovim # Arch
nvim --version | head -1
Much of the modern plugin ecosystem expects a recent release. If your distro ships an older one, the official AppImage or the Flatpak is an easy way to get a current version.
Where configuration lives
Neovim follows the XDG base directory spec:
~/.config/nvim/init.lua your config
~/.local/share/nvim/ plugins and data
~/.local/state/nvim/ undo history, logs, shada
If you already have a ~/.vimrc, the fastest migration is:
" ~/.config/nvim/init.vim
source ~/.vimrc
Most settings will simply work. When you are ready, switch to Lua.
A minimal init.lua
This is a complete, useful config with no plugins:
-- ~/.config/nvim/init.lua
vim.g.mapleader = " "
local o = vim.opt
o.number = true
o.relativenumber = true
o.expandtab = true
o.shiftwidth = 4
o.tabstop = 4
o.ignorecase = true
o.smartcase = true
o.undofile = true -- undo history survives closing the file
o.clipboard = "unnamedplus"
o.termguicolors = true
o.signcolumn = "yes"
-- keymaps
vim.keymap.set("n", "<leader>w", "<cmd>write<cr>", { desc = "Save" })
vim.keymap.set("n", "<leader>q", "<cmd>quit<cr>", { desc = "Quit" })
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<cr>")
-- briefly highlight yanked text
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function() vim.highlight.on_yank() end,
})
vim.opt is the Lua equivalent of :set, and vim.keymap.set replaces nnoremap and friends. clipboard = "unnamedplus" makes yank and paste use the system clipboard, which on Wayland requires wl-clipboard; see our Wayland clipboard guide.
Adding language support
Language servers
Install a server for your language, then enable it. Recent Neovim releases have a simple built-in way to configure servers:
# examples; install whichever you need
sudo pacman -S pyright rust-analyzer lua-language-server
npm install -g bash-language-server
vim.lsp.enable({ "pyright", "rust_analyzer", "bashls" })
The configurations for each server come from the community nvim-lspconfig plugin, which you install once. After that, open a Python file and run :checkhealth vim.lsp to confirm the server attached.
Neovim sets up useful default keymaps when a server attaches:
| Key | Action |
|---|---|
K | Hover documentation |
grn | Rename symbol |
gra | Code actions |
grr | Find references |
Ctrl+] | Go to definition |
[d / ]d | Previous or next diagnostic |
Tree-sitter parsers
Neovim bundles parsers for a few languages (Lua, Vimscript, C, Markdown, and others). The nvim-treesitter plugin installs parsers for the rest.
Plugins
You do not need plugins to use Neovim well, and adding them slowly is the best way to understand your own setup. When you want them, a plugin manager handles installing and updating. lazy.nvim is the most widely used, and recent Neovim versions also include a built-in vim.pack.
A common, restrained starting set:
| Plugin | Purpose |
|---|---|
| nvim-lspconfig | Server configurations for LSP |
| nvim-treesitter | Tree-sitter parser management |
| telescope.nvim or fzf-lua | Fuzzy finding files and text |
| blink.cmp or nvim-cmp | Completion menu |
| gitsigns.nvim | Git change markers in the gutter |
| conform.nvim | Formatting on save |
fzf-lua builds on the same tools covered in our fzf and ripgrep guide, and works best with both installed.
Distributions: LazyVim and friends
LazyVim, AstroNvim, and kickstart.nvim are pre-built configurations. LazyVim and AstroNvim give you a complete IDE-like setup in minutes. kickstart.nvim is different: a single, heavily commented file designed to be read and modified, which makes it an excellent learning tool.
The trade-off with the full distributions is owning a large config you did not write. A common path is to try LazyVim to see what is possible, then build your own small config with kickstart as a reference.
Checking health
When something does not work, Neovim can usually tell you why:
:checkhealth
It reports missing clipboard tools, language servers that are not installed, parser problems, and outdated dependencies.
Vim or Neovim?
If you already use Vim and are happy, there is no need to switch; Vim is actively maintained and has its own modern features. If you want LSP, Tree-sitter, and Lua configuration without a pile of workarounds, Neovim is the smoother path. And if you just need to edit a config file on a server, nano or plain vi is still perfectly fine.
Frequently Asked Questions
What is the difference between Vim and Neovim?
Neovim is a fork of Vim that keeps the same modal editing and most of its commands, but adds Lua as a first-class configuration and plugin language, a built-in Language Server Protocol client, Tree-sitter based syntax highlighting, and an embeddable architecture. Most Vim skills transfer directly.
Where is the Neovim config file?
Neovim reads ~/.config/nvim/init.lua, or init.vim if you prefer Vimscript, following the XDG base directory specification. Run :echo stdpath(‘config’) inside Neovim to print the exact directory it uses.
Can Neovim use my existing vimrc?
Mostly. Neovim does not read ~/.vimrc automatically, but you can create ~/.config/nvim/init.vim containing source ~/.vimrc, and nearly all Vimscript settings will work. Some Vim-only plugins or options may need replacing.
What is LSP in Neovim?
LSP stands for Language Server Protocol. Neovim includes a client that talks to external language servers such as pyright, rust-analyzer or clangd, giving you go to definition, find references, rename, completion and diagnostics for that language without a heavy IDE.
Do I need a plugin manager?
Not to start. Neovim works well with no plugins, and recent versions include a built-in vim.pack plugin manager. Many people use lazy.nvim, which installs plugins on demand and keeps startup fast. Adding plugins gradually is easier to understand than starting from a large distribution.
Should I use a Neovim distribution like LazyVim?
A distribution such as LazyVim or AstroNvim gives you a complete IDE-like setup immediately, which is a good way to see what is possible. The downside is a large configuration you did not write. Many users start with one, then build their own minimal config once they know what they want.