My minimal(?), clutter-free Neovim configuration for day-to-day programming. Everything is reachable from
<space>, so there is nothing to memorize before you start.
mv ~/.config/nvim ~/.config/nvim.bak # back up whatever is there
git clone https://github.com/FoamScience/configs.nvim ~/.config/nvim
nvim +ConfigHealth # see what is still missingTo try it next to your current config instead, clone it elsewhere and pick it with NVIM_APPNAME:
git clone https://github.com/FoamScience/configs.nvim ~/.config/configs.nvim
NVIM_APPNAME=configs.nvim nvimThen press <space> and read the menu.
The screenshots gallery walks through which-key, file exploring, the statusline and winbar, Noice, todo comments, flash hopping, the symbol outline, LSP features and Git operations.
A working config for the languages I write every day:
- C++/C (and OpenFOAM code)
- Python and Lua as scripting languages
- HTML, CSS, JavaScript/TypeScript for web development
- Markdown for documentation, LaTeX for academic writing
- GDScript and GLSL for game development
- Bash for shell scripting
And what it deliberately leaves out:
- Format-on-save is on through conform, but opt-out:
:FormatDisable!for the buffer,:FormatDisableglobally - Chat-style AI assistants (Copilot, CodeCompanion, Avante); the only AI piece is agentfill, an inline completion you trigger by hand
- DAP debugging plugins — removed in favour of simpler debugging workflows
Tip
Best used with Kitty (or Alacritty if you prefer that), running a PowerLine font, or at least a font with some ligature support.
Run :checkhealth config (or :ConfigHealth) to verify your setup, see what is missing and how to install it.
This docker file shows how to install most of it on the latest Ubuntu LTS.
Required:
- Neovim v0.12.x or newer, NodeJS v22 (or newer), preferably installed with NVM
- Python 3 and (optionally) Rust
- The tree-sitter CLI:
npm install -g tree-sitter-cli, or throughcargo - A C compiler (
cc,gccorclang), to build tree-sitter grammars unzip, for installing some LSP servers- RIPGrep, for todo-comments and various other searching tasks
- A terminal with ligature support (Kitty, Warp, Alacritty, etc.)
Optional:
- ImageMagick for in-terminal image display, if your terminal supports it
latex2textto render TeX equations in Markdown- mermaid-cli for mermaid charts in Markdown, rendered through
image.nvim- It drives a puppeteer-managed chrome:
npx puppeteer browsers install chromeif the cache is empty - On Ubuntu 23+ this needs apparmor policy changes around user namespaces; if you do not write mermaid charts often, do not bother
- It drives a puppeteer-managed chrome:
Kitty font setup I use
After installing Comic Code Ligatures, Font Awesome and Symbols Nerd Font Mono:
font_family ComicCodeLigatures
symbol_map U+f000-U+f0e2 fontawesome
symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono
Try it in Docker instead
cd dockerImages
docker build -t nvim-config:latest -f config.dockerfile .
docker run -it --rm nvim-config:latest bash
(container)> USER=me nvimOnce installed, :ConfigNews keeps you up-to-date with this repo by checking for new commits and showing a
changelog.
<space> is the leader key; it opens the which-key menu. Beyond that, a handful of conventions carry most of
the day:
| Keys | What it does |
|---|---|
<tab> / <S-tab> |
move between open buffers |
s / S |
hop anywhere on the visible screen |
<C-w><C-w> |
move between windows and splits — too fundamental to change |
, |
bookmark files per project; preferred over session management |
` / " |
see marks positions / registers content |
<leader>fk / <leader>fC |
list every key binding / every command |
<leader>fP |
jump to an individual plugin's configuration |
<leader>kk |
annotate the current line with a note that stays out of the source |
Typically you will also want Tmux to move between panes with <C-s><arrows>.
General — which-key, pickers, projects, colorscheme, undo
- whichkey.lua: shows all available keymaps
- Press
<leader>to check available keymaps - Shows Vim keymaps on
`(marks),"(registers),z(folds and spelling),g(operators) and<c-w>(window navigation)
- Press
- snacks.lua: fuzzy finder via snacks.picker for files, buffers, etc.
<leader>fto access fuzzy finding features<leader>fkshows all configured keymaps<leader>fgopens file from its Git history without checking out earlier commits<leader>fubrowses the Undo tree with diffs<leader>fPopens Plugin configuration files- Note: Excluded from SSH preset due to performance considerations
- project.lua: a project manager, mostly for detecting root directories
<leader>fpto open recent projects list
- dial.lua: a plugin for incrementing and decrementing stuff
- Overhauled
<c-a>and<c-x>to increment and decrement things (numbers, dates, ..., etc)
- Overhauled
- colorscheme.lua is where the color scheme is set
- Press
<leader>fcto see a live demo of all available color schemes - By default, we are using Catppuccin-Mocha
- Press
- Neovim's built-in
:Undotree(nvim.undotree) visualizes the undo tree.<leader>euto toggle.
UI — explorers, statusline, notifications, Markdown and images
- snacks.lua a collection of UI niceties from folke (includes fuzzy finder)
- snacks.explorer is the sidebar file explorer
<leader>eeto toggle
- oil.lua: file explorer as an editable buffer, replaces netrw
-opens the parent directory
- mini-statusline.lua fast and minimal statusline with enhanced LSP status
- tpipeline.lua unified statusline for Neovim and Tmux
- Displays single statusline across both Neovim and Tmux for seamless integration
- Only loaded in "full" preset
- incline.lua floating buffer names at top-right corners of windows
- noice.lua: cmdline as a popup at the top of the screen; messages stay native
- fidget.lua: LSP progress notifications in the corner
- colorizer.lua: colorizes color codes in CSS, HTML, etc.
- snacks.scroll provides smooth scrolling animations.
- render-markdown.lua: prettifying Markdown document editing.
- With support for Latex equation rendering
- guess-indent.lua to guess indentation style (tabs/spaces)
for current file and setting global options accordingly.
- Should be automatic, but
:GuessIndenthelps
- Should be automatic, but
- image.lua: inline/floating image rendering via image.nvim, replaces
snacks.image- Needs
imagemagick(magick/convert) on PATH, andkittyorweztermwith the kitty graphics protocol enabled <leader>vito render the image under the cursor
- Needs
Productivity — todos, Jira/Confluence, Markdown TOC, images
- todo-comments.lua: highlights
@todo:,@body:,@warn:, etc. in comments<leader>qt(:TodoQuickFix) lists all such comments in the quickfix window- Use todo-issue Github action to convert your committed Todos to Github issues.
- atlassian.lua: conflira.nvim, a thin Jira and Confluence client (merges the former separate jira/confluence plugins)
- Loaded only if
JIRA_API_TOKENorCONFLUENCE_API_TOKENis set - Have to set
JIRA_API_TOKEN/CONFLUENCE_API_TOKEN,JIRA_URL/CONFLUENCE_URLandJIRA_EMAIL/CONFLUENCE_EMAIL <leader>jfor Jira,<leader>cfor Confluence
- Loaded only if
- markdown-toc.lua: auto-generates and updates a Markdown table of contents
- Updates on save for Markdown files
- img-clip.lua: pastes clipboard images into the buffer (e.g. Markdown image links)
- Excluded over SSH
Navigation — flash hopping, outline, quickfix
- flash.lua: fast word hopping
s(orgs) to hop to words in normal modeS(orgS) to hop using tree-sitter syntax tree in normal moderin operator mode to do operations between flash hopsRin operator mode to do operations between flash tree-sitter searches<ctrl-s>to toggle flash in regular search mode<leader>vfor incremental treesitter selection (next:<leader>v, prev:<BS>)
- m2v.lua: semantic code search on model2vec embeddings, fused with ripgrep
<leader>fSto search,<leader>fLfor live search- Only loaded in "full" preset (snacks picker)
- outline.lua: fast local code navigation
<leader>nnto toggle?to see keymaps for the outline window
- qf.lua: nvim-bqf, a better preview and UI for the quickfix window
<leader>qfor quickfix commands (diagnostics, todos, ...)
Language support and LSPs — treesitter, mason, completion, formatting
- treesitter/init.lua: syntax highlighting and code folding, via a thin custom grammar installer (replaces the archived nvim-treesitter plugin)
- Sets up a few languages by default; such as C++, Python, Lua and OpenFOAM
- Auto-installs tree-sitter grammars for languages the first time they are encountered
- with
xonshsupport through the xonsh-lsp
- lspconfig.lua: sets up a few language servers to support common languages
- C++/C: with
clangd, OpenFOAM withfoam_ls, Lua withlua_lsand a few moreclangdis not managed through Mason on ARM machines, runapt install clangdinstead
- Python:
pyrightorpylsp, with support for ParaView Python (pvpython) environments - Type
:Masonin normal mode for more.
- C++/C: with
- lspconfig.lua: configures the LSP servers and sets up keymaps for some features
gdandgDfor go to definition and declarationKfor hover info- Enhanced keybindings for type hierarchy, call graphs, and symbol navigation
- You can also get to similar functionality through
<leader>lwhich uses which-key - Also pulls in clangd_extensions.nvim (AST view, memory usage) for C++ and lazydev.nvim for Lua/
vim.*completion
- cmp.lua: autocompletion engine using blink.cmp (faster than nvim-cmp)
<tab>to cycle through suggestions,<cr>to confirm- Autocompletes file paths, snippets, and LSP-related things
- Includes Unicode character completion provider for special characters
- Buffer completion is left to vim's native:
<c-x>-nmenu - Also provides command line completion on
:
- conform.lua: formatter orchestration (stylua, ruff_format, clang-format, latexindent, typstyle, shfmt, ...)
<leader>lfto format, falling back to the LSP formatter if none matches- Format-on-save;
:FormatDisable[!]/:FormatEnableto toggle
- refactoring.lua: language-aware extract/inline refactors (C++, Python, Lua, ...)
<leader>rfor refactor commands (extract function/variable/block, inline variable)
- lean.lua: Lean 4 theorem prover support via lean.nvim
- Loads for
*.leanfiles
- Loads for
- typst.lua: live-preview for Typst documents via typst-preview.nvim
- Opens the preview in the browser for
typstfiles
- Opens the preview in the browser for
- navic.lua: shows code structure at the cursor in the winbar
Git integration — signs, diffview, GitButler
- gitsigns.lua: shows git diff in the sign column
- diffview.lua: a diff viewer for Git diffs and merge conflicts (diffview-plus.nvim, a maintained fork)
<leader>gdto open, or:DiffviewOpenin normal mode
- butlr.lua: GitButler hunk navigation and actions via butlr.nvim
- Only enabled inside a GitButler-managed repo (needs the
butCLI) <leader>bfor Butler commands (navigate hunks, rub/assign, absorb, discard, undo)
- Only enabled inside a GitButler-managed repo (needs the
Miscellaneous — autopairs, CSV, line notes, cloaking
- autopairs.lua: automatically inserts closing brackets, quotes, etc.
- csv.lua: a CSV viewer/editor using csvview.nvim.
<leader>cvtoggles the aligned CSV display
- haunt.lua: Line notes that do not affect the code source.
<leader>kfor note commands
- agentfill.lua: coding agents as an inline completion source, served from an in-process LSP
<M-c>in insert mode requests a suggestion; nothing is sent unless you ask<C-f>accepts it,<M-n>/<M-p>cycle through suggestions
- herdr.lua: sends line comments and references to a coding agent in a herdr pane
- Loaded only inside herdr (
HERDR_ENVset) <leader>afor agent commands
- Loaded only inside herdr (
- cloak.lua: Hiding environment variables.
:CloackDisableto see the variables' values.
Two presets adapt the config to where you are running it:
- full (default): all plugins enabled
- ssh: excludes plugins that do not work well over SSH, mostly the ones adding latency overhead
Three ways to select one, in order of priority:
# 1. Local preset file — recommended for per-machine configuration
cp ~/.config/nvim/preset.lua.example ~/.config/nvim/preset.lua # then edit the return value
# 2. Environment variable — useful for one-time overrides
NVIM_PRESET=ssh nvim
# 3. Neither of the above: falls back to "full"For remote editing, echo 'return "ssh"' > ~/.config/nvim/preset.lua on the remote machine is usually what you
want.
Keep your customizations in a separate git repository so you can pull updates from here without conflicts:
my-nvim-config/
├── init.lua # Optional: runs before lazy.nvim loads
└── plugins/ # Optional: custom plugin specs
├── my-plugin.lua
└── another.lua
Symlink it into place:
ln -s /path/to/my-nvim-config ~/.config/nvim/user-configOr take mine — mostly niche and experimental:
ln -s user-config.elwardi user-configinit.lua is executed before lazy.nvim initialization, and everything in plugins/ is loaded as a plugin
spec. A spec is just a lazy.nvim table:
return {
"username/my-colorscheme",
config = function()
vim.cmd("colorscheme my-colorscheme")
end
}All plugins are pinned through Lazy.nvim's lockfile, so installations stay consistent and a plugin update
cannot break your editor unannounced. The lazy-lock.json in this repo only seeds your own lockfile, kept at
stdpath("data")/lazy-lock.json, so :Lazy update never touches the repo and git pull never conflicts.
To stay current:
:ConfigNews— fetches the remote, shows how many commits you are behind and a changeloggit pullin the config directory:ConfigLockReset— moves your plugins to the versions pinned by this repo
:Lazy update moves you ahead of the pinned versions; :ConfigLockReset brings you back.
