Neovim on macOS with LazyVim: A Pro Setup in One Afternoon
How we swapped the Mac's stock Vim for Neovim with LazyVim — language servers, fuzzy finding, Treesitter and git, all installed ahead of time so the very first launch is ready to work.
- Neovim v0.12.6
- LazyVim starter
- 38 plugins
- 15 tools
- 32 parsers
Why bother?
macOS ships Vim at /usr/bin/vim. It's part of the system and protected by System Integrity Protection, so you can't delete it — and a macOS update would put it back anyway. The practical move is to stop reaching for it: install Neovim from Homebrew and add a few lines to ~/.zshrc so muscle memory lands in the right place.
# ~/.zshrc
alias vi='nvim'
alias vim='nvim'
export EDITOR='nvim'
On its own, Neovim is a plain editor with a very good engine underneath: a built-in LSP client, Treesitter, and Lua for configuration. What makes it feel like a professional's editor is the layer on top — and that's where LazyVim comes in.
What sits on top of Neovim
LazyVim is a distribution: a curated, maintained set of plugins with sensible defaults that you override in your own files. Many long-time Vim users now start here instead of hand-writing a thousand-line config.
| Piece | What it does |
|---|---|
| lazy.nvim | The plugin manager. Installs, updates and lazy-loads plugins; its window opens with Space l. |
| LazyVim | The distribution: theme, status line, buffer line, dashboard, keymaps and the plugins below, wired together. |
| Extras | Language packs enabled in lazyvim.json: Python, TypeScript, JSON, Markdown, YAML, TOML, Docker. |
| Mason | Installs language servers, linters and formatters into Neovim's own folder — never system-wide. |
| Treesitter | Real parsers for highlighting, indenting and text objects. 32 languages compiled. |
| vim.lsp | Neovim's built-in LSP client, talking to the servers Mason installed. |
The install, step by step
Everything below ran once. The goal: a first launch with nothing left to download.
-
Install the tools LazyVim leans on. ripgrep for searching, fd for finding files, lazygit for git, and the tree-sitter CLI for compiling parsers.
rg,fzf, Node and a Nerd Font (JetBrains Mono) were already on this Mac.brew upgrade neovim brew install fd lazygit tree-sitter-cli -
Clone the starter config. Then drop its git history, so the config is yours to commit wherever you like.
git clone --depth 1 https://github.com/LazyVim/starter ~/.config/nvim rm -rf ~/.config/nvim/.git -
Pick your languages. Extras are listed in
~/.config/nvim/lazyvim.json. You can also toggle them later from:LazyExtras.{ "extras": [ "lazyvim.plugins.extras.lang.python", "lazyvim.plugins.extras.lang.typescript", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", "lazyvim.plugins.extras.lang.yaml", "lazyvim.plugins.extras.lang.toml", "lazyvim.plugins.extras.lang.docker" ] } -
Install the plugins headlessly. This pulls all 38 plugins without opening a window.
nvim --headless "+Lazy! sync" +qa -
Install the language tools. A plain
MasonInstallfailed here withE492: Not an editor command— Mason is lazy-loaded, so its commands don't exist yet when Neovim starts headless. Loading it first fixes that.nvim --headless -c "Lazy! load mason.nvim" \ -c "MasonInstall lua-language-server pyright ruff vtsls json-lsp marksman \ markdownlint-cli2 markdown-toc yaml-language-server taplo \ dockerfile-language-server docker-compose-language-service hadolint" -c qall -
Compile the parsers. Otherwise they build during your first launch while you wait.
nvim --headless -c "Lazy! load nvim-treesitter" \ -c "lua require('nvim-treesitter').install({'python','lua','typescript','tsx', ...}):wait(600000)" -c qa -
Check its health.
:checkhealth lazyvimcame back clean: Neovim ≥ 0.11.2, git, rg, fd, lazygit, fzf, curl, a C compiler and the tree-sitter CLI all found.nvim "+checkhealth lazyvim"
What's installed
The 15 tools in Mason
- pyright
- ruff
- vtsls
- lua-language-server
- stylua
- shfmt
- json-lsp
- yaml-language-server
- taplo
- marksman
- markdownlint-cli2
- markdown-toc
- dockerfile-language-server
- docker-compose-language-service
- hadolint
They live in ~/.local/share/nvim/mason/, each in its own folder. Nothing lands in /usr/local or your global npm. Press Space c m to update or add more.
Where the config lives
~/.config/nvim/
├── init.lua -- loads lua/config/lazy.lua
├── lazyvim.json -- the extras you turned on
└── lua/
├── config/
│ ├── options.lua -- vim.opt settings
│ ├── keymaps.lua -- your own mappings
│ ├── autocmds.lua
│ └── lazy.lua -- plugin manager bootstrap
└── plugins/ -- one file per plugin you add or override
The keys worth learning first
Space is the leader key. Press it and wait a moment: which-key shows everything that follows, so you won't need a cheat sheet for long.
| Keys | What it does |
|---|---|
Space Space | Find a file by name |
Space / | Search text across the project (ripgrep) |
Space e | Toggle the file tree |
Space , | Switch between open buffers |
g d · g r · K | Go to definition · references · show docs |
Space c a | Code action (quick fix) |
Space c r | Rename a symbol everywhere |
Space x x | All diagnostics in a list |
Space g g | lazygit, full screen |
Space l · Space c m | Plugins · language tools |
Things that tripped us up
"SF Mono", Menlo, "JetBrainsMono Nerd Font Mono", monospace) and the terminal falls back to it for the icons only.
lazyvim, and it was all green.
/usr/bin/vim by path still get the stock one — and that's fine.
Where to go next
- Open
:LazyExtrasto add more languages (Go, Rust, Tailwind…) or editor extras. - Put personal settings in
lua/config/options.luarather than editing plugins. - Each file in
lua/plugins/returns a spec that LazyVim merges with its own, so overriding a plugin is usually three lines. - When something feels slow,
:Lazy profileshows exactly which plugin is to blame.
Written after setting this up on a MacBook Air with Homebrew. Versions as installed: Neovim 0.12.6, LazyVim starter, tree-sitter CLI 0.27.1, lazygit 0.66.2, fd 10.5.0.
Comments
Post a Comment