Neovim Option Switchboard
Up: Neovim Config Tutorial Down: bootstrap, plugins
The global O table is the config’s breaker panel. Each switch decides whether a whole family of plugins should be awake.
Defaults First
lua/user-defaults.lua creates safe defaults:
O = {
is_nixos = vim.fn.filereadable("/etc/NIXOS") == 1,
lsp = false,
git = false,
test = false,
dap = false,
misc = false,
language_parsing = true,
}The defaults make the config survivable on a fresh machine. If a plugin family is not explicitly enabled, it does not assume the world is ready.
User Settings Then Open Rooms
user-settings.lua turns on the local workstation personality. It enables LSP, Git, completion, formatting, tests, DAP, notes, notebooks, databases, web development, and a selected colorscheme.
The pattern is simple:
O.lsp = true
O.git = true
O.format = true
O.test = true
O.dap = true
O.obsidian = true
O.colorscheme = "catppuccin-mocha"That makes plugin specs readable. A plugin can say enabled = O.git instead of burying personal workflow decisions inside its setup block.
Why This Works Well
Feature flags make the config movable.
You can carry it to a headless machine and keep only language parsing. You can open it inside VS Code and skip the plugin garden. You can disable notebooks or AI without ripping out code.
NixOS Is A First-Class Option
O.is_nixos is not decorative. It affects shell paths, Mason enablement, language server path lookup, and debugger adapter lookup.
O.shell = O.is_nixos
and "/run/current-system/sw/bin/zsh"
or "/usr/bin/zsh"That keeps platform differences explicit and boring.