Happy holidays!
Today we discuss Neovim, the Vim successor that is replacing VS Code/Cursor as the host of my development environment.

Don’t use a distro
I thought I could get off to a good start with Neovim quickly by using NvChad. It worked, but only mildly; whenever I wanted to add my own config, I had to fight NvChad’s custom setup to get things to work (e.g., installing a custom theme was brutal). NvChad is super batteries-included, which is nice in some aspects, but didn’t force me to learn the actual components that make Neovim powerful. I had little idea of what was going on, and only learned everything when I took the time to create my own config. I found it incredibly rewarding, and believe that you will as well.
This article delineates every step I took to set up Neovim from scratch as an IDE, including auxiliary steps like configuring tmux and my terminal itself.
I wish there were a TL;DR I could provide for this article, but that would be a disservice; it took over a month to learn and perfect a Neovim config (not counting tmux/terminal config), and the point of this article is to teach the moving parts that make Neovim powerful. As such, it is necessarily (and unashamedly) a longer article. If lacking time, skim the config directly in my dotfiles repo, but note that there is no substitute for putting in the time and effort.
Guiding principles
- Automatic (on hooks/events) > manual invocation.
- Aesthetics are of utmost importance, only second to functionality.
- Functionality must have good UX, and be lightning fast.
- Minimalism.
- Simple > complex.1
- Config should be well-organised, declarative, and follow YAGNI.
- On plugins and dependencies:
- Don’t pull in something that could be accomplished by a line of config or two.
- Plugins are okay, but should ideally be well-maintained.
- Adhering to convention is important (avoid anything highly custom or niche).
Installs
ghosttyterminal emulator- I recommend installing from source (instead of a Homebrew cask) to let its auto-updater work best.
starshipshell prompt- Neovim for our text editor—the star of the show. We’ll be turning it into a full-fledged IDE via plugins and configuration.
tmux+tpack(for managing plugins). Tmux does two things:- Multiplexes a single terminal session.2
- Lets us edit in a tmux session, which lets us attach and detach from the session freely. Our code editing session is opened in a background process that we attach or detach from freely, meaning we are no longer bound by a Ghostty process’ lifetime.
tmuxinatoris a declarative way of managing projects in tmux.3
Other than Ghostty4, we can install the above + some required terminal tools in one brew command:
brew install neovim tmux tpack tmuxinator fzf fd rg tree-sitter This article assumes macOS, although most things here should be fine on Linux, subject to some tweaking.
Terminal Emulator
We’ll use Ghostty for these reasons. I also like Mitchell Hashimoto and trust what he builds, so Ghostty is the obvious choice in terminals for me. Mitchell’s Ghostty devlogs are a great read. I previously used iTerm2 for years, but there were many things I disliked about it. I have heard Kitty and WezTerm are other great options here.
Below is my Ghostty configuration; it’s mostly for looks, but some customises functionality. It’s been stable for quite some time now.
To enable cursor movement animation, you’ll need to install cursor-shaders according to the install instructions in the repo.
You’ll want to install a Nerd Font to have nice dev icons and ligatures. Oftentimes these come in different forms: a standard form, a “Mono” form, and a “Propo” form. You’ll want the standard variant, which Ghostty supports very well. The characters will still be monospaced, despite it not being the one ending in “Mono”.
# Theme
theme = Earthsong
# Window
background-opacity = 0.7
background-blur-radius = 15
window-height = 26
window-width = 80
# Titlebar
macos-titlebar-style = tabs
window-title-font-family = FiraCode Nerd Font
# Font
font-family = FiraCode Nerd Font
# Custom Cursor Style
cursor-style = underline
shell-integration-features = no-cursor
# Cursor Shaders
# - Ref: https://github.com/sahaj-b/ghostty-cursor-shaders
custom-shader = shaders/cursor_warp.glsl
# Quick Terminal
keybind = global:option+grave_accent=toggle_quick_terminal
# App Icon Customisation
macos-icon = custom-style
macos-icon-ghost-color = White
macos-icon-screen-color = BlanchedAlmond
# Notifications
notify-on-command-finish = unfocused
notify-on-command-finish-action = bell,notify
notify-on-command-finish-after = 4s
# Splits
unfocused-split-opacity = 0.8 Shell Prompt
We’ll use Starship, because it’s fast, configurable with nice presets, and looks good. I used to use Powerlevel10k, but switched to Starship as it’s a little more modern and works better out-of-the-box for me.
Install, then run starship config, then add the following config (or customise to your liking):
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
command_timeout = 1000 # double the default of 500
# Replace default prompt
[character]
success_symbol = '[➜](bold green)'
error_symbol = '[➜](bold red)' Terminal Multiplexer
We’ll use tmux as it is well-maintained, stable, and has a great ecosystem. There are other newer players such as herdr and Rex, alongside the older GNU Screen, but tmux works for now. I’m not opposed to another solution; a terminal multiplexer in general is something I’d like to do away with entirely down the road once I figure out how.
Package manager
We will use tpack. It’s written in Go, which is a bit better than the incumbent tpm, written in Bash.
Tmux Plugins
- vim-tmux-navigator lets us navigate between Neovim buffers and tmux panes as if they are the same program (i.e., with a unified set of keybindings (
<ctrl-h>→ move left,<ctrl-j>→ move down, etc.)). - tmux-continuum and tmux-resurrect to ensure that tmux sessions continuously save and are restored properly on system restart.
Tmux Config
I don’t want any sort of tmux status bar, as it makes the screen busy when used with vim’s status bar, but also is simply visual clutter; there’s no need for it. We will preview and switch between tmux windows via <Prefix>w.
Tmux was always a bit confusing to me, until I properly learned the difference between a session, windows, and panes. This guide was instrumental for my learning.
The following is my tmux config, built with help from many sources.5678
# Plugins
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'off'
# Set tmux to use 24-bit colour
set -sa terminal-overrides ",xterm*:Tc"
# Remap tmux leader to Ctrl-a (easy with caps lock remapped to ctrl)
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Split panes using | and - instead of " and %, respectively
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# Just in case…
set -g mouse on
# Increase scrollback buffer size from 2000 to 50000 lines
set -g history-limit 50000
# Increase tmux messages display duration from 750ms to 4s
set -g display-time 4000
# Disable status bar entirely
set -g status off
# Windows
set -g renumber-windows on
set -g base-index 1
# Initialise tpack (this line must stay at the very bottom of this file)
run 'tpack init' Example tmuxinator Project
Then open a tmux session with tmux, then install plugins with Prefix + Shift + i.
name: camball.io
root: ~/
startup_window: editor
windows:
- editor:
layout: main-vertical
root: ~/code/camball.io
panes:
- editor: nvim
- server:
layout: main-vertical
root: ~/code/camball.io
panes:
- server: pnpm dev:blog Initialise Neovim config
We’ll have the following config file structure:
$ tree
~/.config/nvim
├── init.lua
├── lazy-lock.json
└── lua
├── config
│ ├── keymaps.lua
│ ├── langmaps.lua
│ └── lazy.lua
└── plugins
├── example.lua
└── ... One note is that for plugins, we’ll be naming the plugin files according to the function they accomplish rather than by the name of the plugin they install. I prefer this philosophy because there may come a day where we choose to update a specific plugin that accomplishes a specific goal for us, but the goal itself doesn’t change. Likewise, certain functions/goals may require more than one plugin, and we can scope them to the same flat config file to keep organised. See what I mean in the plugins/ directory in my dotfiles repo.
Neovim package manager
While vim.pack was introduced in 0.12, it wasn’t easy to set up and still had rough edges, so I went with lazy.nvim. I followed the Structured Setup instructions in the docs. It’s quite intuitive and can be used simply via :Lazy. Lazy automatically loads plugins defined in the lua/plugins/ directory, which lets us have a super clean init.lua.
I’ll likely move to vim.pack in the future when it’s more stable.
Neovim theme
I like “earthsong”. I use earthsong for my Ghostty config (theme = Earthsong), and want Neovim to match. Conveniently, a kind soul already made an earthsong plugin for Neovim. I followed the lazy.nvim install instructions from the README, but with a couple tweaks for transparency + highlight groups.
I also wanted transparency support (to match my Ghostty config) and had to add some custom highlight groups, which only required a tad bit of config.
Navigating fluidly between vim windows and tmux panes
We’ll install vim-tmux-navigator in two parts, so that vim and tmux can communicate:
- On the Neovim side, using the instructions for lazy.nvim.
- On the tmux side, we already added the plugin to our tmux config [[#Tmux Config|above]] (
set -g @plugin 'christoomey/vim-tmux-navigator').
Finding and grepping files
I originally had Telescope for this, but went with fzf-lua for a few reasons:
- Works faster on large repos.
- It relies on
fzf, which I already have installed on my machine. - It doesn’t require Plenary, which is now no longer maintained (June 2026).
fzf-lua is a generic picker and can do much more than simply find and grep files, but that’s all I really want as of now. We’ll configure <Leader>ff and <Leader>fg mappings for these actions, respectively.
Buffer management
We’ll also use fzf-lua to power buffer management. Many Neovim “distros” include some sort of “tab” concept (one buffer ⇔ one “tab”) that fights vim’s native buffer/window/tab model, so we’ll intentionally not include something like barbar.nvim. We’ll map <Leader>fb to FzfLua buffers so that we never have to worry about “managing” open files ourselves; we always fuzzy find for everything. Buffers are a part of vim’s power, and it took me a bit to understand that.
LSP management
Our goal here is to have a declarative and minimal way of installing and managing LSPs (installing, updating, etc.). We handle this via a few different parts:
- Neovim’s native LSP client: Receives info from language servers to provide to Neovim as an LSP client. Built in to Neovim.
- nvim-lspconfig: For any installed LSP, provides server configurations to the aforementioned Neovim LSP client.
- Mason: Package manager for installing and updating LSPs themselves. Used the recommended declarative setup for lazy.nvim. Open the GUI with
:Mason. - mason-lspconfig: From the docs, “translate between
nvim-lspconfigserver names andmason.nvimpackage names” and automaticallyvim.lsp.enable()installed servers.
We install and configure all of these in a single scoped config file (~/.config/nvim/lua/plugins/mason-lspconfig.lua):
return {
"mason-org/mason-lspconfig.nvim",
-- Install these servers and automatically enable them.
opts = {
ensure_installed = {
-- Lua
"lua_ls",
-- Python
"ty",
"ruff",
-- Others
...,
},
},
dependencies = {
-- Installs the actual language-server programs.
{ "mason-org/mason.nvim", opts = {} },
-- Supplies standard configurations for those servers.
"neovim/nvim-lspconfig",
},
} We intentionally excluded formatters from the above config; those will be installed in a related, but separate way, discussed below.
We specify nvim-lspconfig identifiers in the ensure_installed block and our setup will automatically take care of installing and configuring them. I installed LSPs, formatters, and linters for Lua, various web languages, and Python. View the full list here.
Syntax highlighting and treesitter
While the regex-based syntax on Vim built-in works great for syntax highlighting, Treesitter is more accurate, working at the AST level. Treesitter does much more than solely syntax highlighting (such as powering folds in the editor), but syntax highlighting is our primary focus here. We’ll specify languages to highlight for in the pattern Lua table in the config file, then can install any parsers we need with:
:TSInstall lua python javascript typescript tsx html css svelte Completions and bracket auto-pairing
We’ll add the following to a single lua/plugins/completions.lua config file containing both plugins:
- I went with blink.cmp over nvim-cmp for these reasons, and that there was a new v2 out. Ensure you have cargo installed, then add the plugin configuration. I changed the
defaultsettings tosuper-tabto be able to accept completions with the tab key. - We’ll also add nvim-autopairs to automatically complete openings like
[,(, and".
Formatting
While we’ll install formatters as LSPs, that doesn’t mean they belong in mason-lspconfig’s ensure_installed list. So that we don’t need to manually install (like :MasonInstall stylua oxfmt), we’ll install another plugin to declaratively manage formatters (and potentially other Mason-installed tools down the road): mason-tool-installer.nvim.
Format-on-save makes life easy. I’d love a solution that works across languages, doesn’t require much language-specific config, and has a uniform API across languages. conform.nvim makes this easy.
Editor enhancements
Just a couple rather boilerplate items we’d like to have, so we’ll add them to init.lua:
- Line numbers (relative)
- Disabling line wrapping (makes code impossible to read)
As of Neovim 0.13, we no longer need to handle refreshing buffers (with :checktime or otherwise) ourselves or with a plugin when the contents of the file are changed outside the open buffer (e.g., by a formatter or AI agent).
macOS clipboard integration
I originally had this configured via vim.opt.clipboard = "unnamedplus" in my init.lua. This got quite annoying sharing the system clipboard with vim’s registers. For example, I’d copy something outside Neovim, ci" in Neovim, then suddenly I overwrote my clipboard contents with what I’m trying to replace.
I feel that the optimal solution here is to keep the systems separate, but make them convenient to use. We still take advantage of a solution hinging on macOS’s built-in pbcopy and pbpaste commands (YMMV outside of macOS; the docs are complex); we’ll simply use the Neovim default "+y/"+p for copying/pasting (respectively), but those are awkward motions IMO. I simply remapped them in lua/config/keymaps.lua to <Leader>y/<Leader>p.
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y')
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p') With these, motions work the same way, just with a different start. E.g., <Leader>y3y to copy the next three lines to the clipboard.
Bracket-pair colourisation and scope guides
This section is a bit more custom than other sections; full config file available in my dotfiles repo.
We’ll add the indent-blankline.nvim plugin to a scoped plugin config file. I added some special settings to get everything looking right.
We already installed treesitter, so we get scope highlighting by simply specifying scope to be enabled in our config. I unfortunately had to handicap the visual scope demarcation feature to only left-side vertical line highlighting though (instead of also horizontal scope highlighting above the current scope), because it doesn’t look pixel perfect across displays with differing pixel densities, such as a Macbook’s retina screen and a Samsung external monitor.9
This is where we also add bracket pair colourisation via rainbow-delimiters.nvim (as a Lazy dependency of indent-blankline.nvim). We set the rainbow_delimiters highlight colours to pull them from our earthsong theme as well so everything looks cohesive.
Displaying whitespace when in visual mode
We’ll add the visual-whitespace.nvim plugin to a scoped config file with default settings.
Indentation
Indentation is tough, and I’ve yet to come across any sort of perfect polyglot solution. In VS Code or Cursor, I never even thought about indentation and its complexities, aside from the occasional manual override. I need indentation to work for a variety of languages, such as Python, Svelte, TypeScript, JSON, YAML, etc. I don’t want to have to check any project-specific config files into repos, but at the same time, I’d ideally like my editor to detect the indentation being used on the current file (e.g., one repo might use 2-space YAML, and another 4-space YAML; the editor should automatically configure itself for both).
The solution I’m currently rocking is the guess-indent.nvim plugin + defaulting to 2-space indentation if it can’t guess the indentation correctly, and I do this in a single lua/plugins/indentation.lua file:
return {
"NMAC427/guess-indent.nvim",
-- Establish fallback settings before GuessIndent examines any buffers
init = function()
-- Indent with spaces when Tab key is pressed
vim.opt.expandtab = true
-- Default to two-column indentation (if a file doesn't provide enough evidence)
vim.opt.shiftwidth = 2
-- Make Insert-mode Tab and Backspace follow shiftwidth
vim.opt.softtabstop = -1
end,
-- Automatically detect indentation in existing files
opts = {},
} We also enable nvim-treesitter’s vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" in the treesitter config file, which works in complement to the above. It’s currently experimental, but hopefully it will become stable in time.
At a high level, these parts come together like the following:
- Neovim defaults (indent with two spaces).
guess-indenttries to guess the file’s existing indentation style and override Neovim’s defaults for the specific buffer.- Treesitter tries to calculate the correct syntax-aware indentation level.
I’m still trying this setup out, and may switch to Tim Pope’s vim-sleuth (which I believe has better heuristics) if my current setup is annoying when switching between languages.
Find-and-replace Functionality
There are built-in ways to do this, but they are more cumbersome than I’d like, so I opted to install grug-far.nvim to handle this elegantly. The only special thing I did was include a custom mapping to launch it with <Leader>sr.
Clear Search Highlighting
It’s annoying to search for a term with / and all instances of the term remain highlighted after we’re done searching. I added a config file to hold all custom key mappings (lua/config/keymaps.lua), sourced it in init.lua (require("config.keymaps")), and added the following shortcut there that we’ll use to explicitly clear the highlight:
-- Hide search highlighting without clearing the search itself.
vim.keymap.set("n", "<leader>/", "<cmd>nohlsearch<CR>", {
desc = "Clear search highlighting",
}) Git Integration
I used to use the GitLens VS Code extension and enjoyed how it’d show me git blame info for the current line, and it’s nice to have visual cues for changed lines. gitsigns.nvim handles this perfectly in Neovim. The 1000 ms default delay time felt laggy to me, so I decreased it to 100 ms. Popups gains a border for visual clarity from our global vim.opt.winborder = "rounded" we added to init.lua. We map the following keybinds:
<Leader>gb: See blame info for current line<Leader>gB: Open the blame view/buffer for the full file<Leader>gp: See what changed on the current line (more accurately, the current “hunk”, the contiguous group of changes under the cursor)
Diagnostic Info
I want a clean way of seeing when code has warnings/errors. tiny-inline-diagnostic.nvim is seriously good at this. I may test trouble.nvim out in the future if I find I want a dedicated diagnostic display buffer.
We’ll configure it to only show warnings (and lower levels) when the cursor is on the offending line, but anything with severity vim.diagnostic.severity.ERROR or higher will be shown on all offending lines. We’ll stick with the default configuration where diagnostics aren’t shown in insert mode to avoid transient errors while typing.
As always, we can still view diagnostic info with <C-w>d.
Command and search UI enhancements
Not necessary, but I’d prefer a cleaner TUI for the Vim command mode and search. We’ll add the noice.nvim plugin to take care of this, with nvim-notify to provide a nicer UI for notifications.
As a default, we’ll set vim.opt.winborder = "rounded" in init.lua so that, by default, other parts of our config have a border. Without a border, pop-up panes (e.g., LSP hover with Shift + k on a symbol in a file) are hard to read if there’s nothing distinguishing their text from the text of the buffer underneath. Other parts of our setup inherit from winborder, such as gitsigns.nvim and the native diagnostic display (<C-w>d).10
Start screen customisation
I wasn’t a fan of the the way the default start screen looks, so I customised mine, settling on the alpha-nvim plugin.
I took a look at this design inspo thread, made a custom shape in Affinity Designer, converted it to Braille text art using this great generator, then set it as dashboard.section.header.val in my config. I also customised the initial shortcuts to be a bit more minimal; I can add more with time when needed.
Some functionality I wanted that isn’t part of the plugin is for the start screen to appear when the last buffer is closed, but Neovim is still open (I want it to return to the start screen). I added a tiny helper function in the config to invoke :Alpha under that condition.
Filetree
I wanted a filetree for easier exploration of new project structures. Debated adding this since it may simply be easier to simply use tree like normal (brew install tree). For this, I added config for nvim-tree.lua with one basic mapping of <Leader>e to open the file explorer. Most of the useful key commands are already included it appears:
o(or<Enter>) to open a file or expand/close a directoryato create a file or directorydto delete an item, with confirmationqto close the file tree
Status line
This is mostly for looks, but is helpful to always have a couple things at a glance, such as the filename and current git branch. I keep mine pretty minimal. Went with lualine.nvim and customised to my liking, based on their bubbles example, but using our configured earthsong theme.
- “Simplicity is prerequisite for reliability” ~Edsger Dijkstra↩
- Note that while Ghostty has native support for “splits”, these are effectively ephemeral and will need to be remade any time we want to open our project in a new Ghostty tab. We have effectively no way of declaring several splits and being able to spin up that same configuration across multiple terminal windows. For this reason, we use tmux and
tmuxinator. See Ghostty + tmux - The Productivity Setup I Actually Use by Samuel Lawrentz for a better understanding here.↩ - For understanding why we’d want
tmuxinator, think of what our situation looks like withouttmuxinator. We’d need to create a custom shell script with a bunch of imperative commands such astmux new-session -d -s zrok, thentmux rename-window -t zrok:0 'frontend', followed bytmux send-keys -t zrok:0 'zrok share public 8080' C-m. Shell scripts like that are usually very flaky; much nicer to do this declaratively.↩ - Ghostty can be installed as a Homebrew cask, but I prefer to let Ghostty handle its own auto-update functionality.↩
- Dreams of Code – Tmux has forever changed the way I write code.↩
- Ham Vocke – Make tmux Pretty and Usable↩
- Sam Bernheim – Customizing Tmux↩
- Vimothee – tmux.conf that gets the job done↩
- I really tried to make this work, but simply couldn’t. In short, in Ghostty, I could get things to look fine on either my Macbook’s built-in retina display, or my Samsung Odyssey G9 monitor. I could get things to look flawless on my Macbook’s display by setting the Ghostty settings
adjust-underline-position = 6andadjust-underline-thickness = 1and changing theindent-blankline.nvimindent character withchar = "▏"(eighth-width box drawing character) instead of the default quarter-width character. I didn’t love the idea of modifying Ghostty’s global underline rendering behaviour, but it looked decent across a variety of tests on my Macbook’s screen. It wasn’t until testing on my external monitor that I found the underline to be a few pixels thicker than it was on the Macbook screen (I am no expert, but I believe this is due to differing pixel densities (I don’t believe my external monitor is scaled at all)).↩ - Blink completions are supposed to as well, but weren’t working for me, so I added a fix to blink’s config directly.↩