TL;DR:
- Neovim with Lazy.nvim, nvim-lspconfig, and Treesitter gives you a fast, IDE-quality editing experience with full control over every component.
- The setup takes 2–3 hours to configure well, but the result is an editor that starts in under 100ms and runs identically on any machine.
- avante.nvim (or codecompanion.nvim) brings Claude and other LLM assistants into Neovim without leaving the terminal.
- Skip the starter frameworks (LazyVim, NvChad) until you understand what each layer does — they create black boxes you can’t debug.
A lot has changed in the editor landscape over the past two years. AI coding assistants have become table stakes. VS Code has added agent mode. Cursor and Windsurf have come and gone from dozens of teams’ workflows. Through all of this, Neovim’s position has remained stable: it’s still the fastest general-purpose editor, it runs anywhere, and the control it gives you over your environment is unmatched.
This guide covers a pragmatic 2026 Neovim setup from a reasonably clean starting point.
The Stack
A modern Neovim setup has four layers:
- Plugin manager: Lazy.nvim (replaced Packer, the previous standard)
- LSP: nvim-lspconfig + mason.nvim (installs language servers automatically)
- Syntax highlighting: nvim-treesitter
- AI assistant: avante.nvim or codecompanion.nvim
Optional but widely useful: telescope.nvim (fuzzy finding), nvim-cmp (completion), and conform.nvim (formatting).
Installing Lazy.nvim
Lazy.nvim is a declarative plugin manager that lazy-loads plugins by event, command, or filetype. Plugins that aren’t needed on startup don’t load at startup. This is why Neovim setups with 40+ plugins can still start in 30–50ms.
Add this to your ~/.config/nvim/init.lua:
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins")
This tells Lazy to load plugin specs from ~/.config/nvim/lua/plugins/. Each file in that directory returns a table describing one or more plugins. The modular structure keeps configuration readable.
LSP With mason.nvim
mason.nvim installs language servers, linters, and formatters into Neovim’s data directory — no system-level installation required. nvim-lspconfig connects those servers to Neovim’s built-in LSP client.
Create ~/.config/nvim/lua/plugins/lsp.lua:
return {
{
"williamboman/mason.nvim",
build = ":MasonUpdate",
opts = {},
},
{
"williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = { "lua_ls", "pyright", "ts_ls", "rust_analyzer" },
},
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
-- servers installed by mason-lspconfig are auto-configured
-- add server-specific settings here as needed
end,
},
}
Run :Mason after startup to see and manage available servers. :MasonInstall pyright installs the Python language server manually if needed.
Treesitter for Syntax and More
nvim-treesitter replaces Neovim’s regex-based syntax highlighting with parse-tree-based highlighting. The visual difference is significant — code looks right even in edge cases where regex highlighting fails.
Treesitter also powers code folding, text objects (]f to jump to next function, af to select a function body), and indentation.
-- lua/plugins/treesitter.lua
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
opts = {
ensure_installed = { "lua", "python", "typescript", "rust", "go", "markdown" },
highlight = { enable = true },
indent = { enable = true },
},
}
Adding AI Assistance: avante.nvim
avante.nvim brings a Cursor-like AI panel into Neovim. You can ask questions about the current file, request inline edits, and run multi-file changes from a floating window. It supports Claude, GPT-4, and local models via Ollama.
-- lua/plugins/ai.lua
return {
"yetone/avante.nvim",
event = "VeryLazy",
opts = {
provider = "claude",
claude = {
model = "claude-sonnet-4-6",
max_tokens = 8192,
},
},
build = "make",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
},
}
Set your API key: export ANTHROPIC_API_KEY=sk-ant-... in your shell profile.
The default keymaps are <leader>aa to open the chat sidebar, <leader>ae to explain the selected code, and <leader>ar to refactor.
An alternative is codecompanion.nvim, which takes a more minimal approach and integrates better with existing Neovim workflows for developers who want AI assistance without a persistent sidebar.
Fuzzy Finding With Telescope
Telescope is Neovim’s standard fuzzy finder. It handles file search, grep, git log, LSP references, and dozens of other pickers through a unified floating window interface.
-- lua/plugins/telescope.lua
return {
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{ "<leader>ff", "<cmd>Telescope find_files<cr>" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>" },
{ "<leader>fr", "<cmd>Telescope lsp_references<cr>" },
},
}
Install ripgrep (brew install ripgrep or apt install ripgrep) for live_grep to work correctly.
Performance Expectations
A well-configured 2026 Neovim setup with 20–30 plugins starts in 40–80ms. For comparison, VS Code starts in 2–5 seconds, Cursor in 3–6 seconds. For SSH sessions into remote machines, this difference becomes dramatic — Neovim over SSH is genuinely fast, while Electron editors become sluggish.
The cost is configuration time. Budget an afternoon to get LSP working correctly for your primary language, another hour for treesitter, and testing time to verify everything works together. The payoff is an editor you understand completely and can debug when something breaks.
Skip the Distributions (At Least Initially)
LazyVim, AstroNvim, and NvChad are pre-configured Neovim distributions that get you to a working IDE in minutes. They’re well-made, and experienced Neovim users run them successfully. But starting with a distribution means you’ll have a configuration you don’t fully understand, can’t debug, and struggle to modify.
Build your own first. You’ll learn more, end up with exactly what you need, and be able to make informed choices about what a distribution adds or changes.