Skip to content

About

Minimal NeoVim configuration for day-to-day programming

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Repository files navigation

configs.nvim — a Neovim configuration driven from one leader key, showing the which-key panel with the find, LSP, git, edit, navigation, test, CMake, refactor, notes, butler and select groups

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 missing

To 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 nvim

Then press <space> and read the menu.

What it looks like

screenshot

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.

What it is

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, :FormatDisable globally
  • 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

Getting started

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 through cargo
  • A C compiler (cc, gcc or clang), 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
  • latex2text to 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 chrome if 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
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 nvim

Once installed, :ConfigNews keeps you up-to-date with this repo by checking for new commits and showing a changelog.

How you drive it

<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>.

Plugins

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)
  • snacks.lua: fuzzy finder via snacks.picker for files, buffers, etc.
    • <leader>f to access fuzzy finding features
    • <leader>fk shows all configured keymaps
    • <leader>fg opens file from its Git history without checking out earlier commits
    • <leader>fu browses the Undo tree with diffs
    • <leader>fP opens Plugin configuration files
    • Note: Excluded from SSH preset due to performance considerations
  • project.lua: a project manager, mostly for detecting root directories
    • <leader>fp to 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)
  • colorscheme.lua is where the color scheme is set
    • Press <leader>fc to see a live demo of all available color schemes
    • By default, we are using Catppuccin-Mocha
  • Neovim's built-in :Undotree (nvim.undotree) visualizes the undo tree. <leader>eu to 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>ee to 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 :GuessIndent helps
  • image.lua: inline/floating image rendering via image.nvim, replaces snacks.image
    • Needs imagemagick (magick/convert) on PATH, and kitty or wezterm with the kitty graphics protocol enabled
    • <leader>vi to render the image under the cursor
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_TOKEN or CONFLUENCE_API_TOKEN is set
    • Have to set JIRA_API_TOKEN/CONFLUENCE_API_TOKEN, JIRA_URL/CONFLUENCE_URL and JIRA_EMAIL/CONFLUENCE_EMAIL
    • <leader>j for Jira, <leader>c for Confluence
  • 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 (or gs) to hop to words in normal mode
    • S (or gS) to hop using tree-sitter syntax tree in normal mode
    • r in operator mode to do operations between flash hops
    • R in operator mode to do operations between flash tree-sitter searches
    • <ctrl-s> to toggle flash in regular search mode
    • <leader>v for incremental treesitter selection (next: <leader>v, prev: <BS>)
  • m2v.lua: semantic code search on model2vec embeddings, fused with ripgrep
    • <leader>fS to search, <leader>fL for live search
    • Only loaded in "full" preset (snacks picker)
  • outline.lua: fast local code navigation
    • <leader>nn to toggle
    • ? to see keymaps for the outline window
  • qf.lua: nvim-bqf, a better preview and UI for the quickfix window
    • <leader>q for 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 xonsh support through the xonsh-lsp
  • lspconfig.lua: sets up a few language servers to support common languages
    • C++/C: with clangd, OpenFOAM with foam_ls, Lua with lua_ls and a few more
      • clangd is not managed through Mason on ARM machines, run apt install clangd instead
    • Python: pyright or pylsp, with support for ParaView Python (pvpython) environments
    • Type :Mason in normal mode for more.
  • lspconfig.lua: configures the LSP servers and sets up keymaps for some features
    • gd and gD for go to definition and declaration
    • K for hover info
    • Enhanced keybindings for type hierarchy, call graphs, and symbol navigation
    • You can also get to similar functionality through <leader>l which 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>-n menu
    • Also provides command line completion on :
  • conform.lua: formatter orchestration (stylua, ruff_format, clang-format, latexindent, typstyle, shfmt, ...)
    • <leader>lf to format, falling back to the LSP formatter if none matches
    • Format-on-save; :FormatDisable[!] / :FormatEnable to toggle
  • refactoring.lua: language-aware extract/inline refactors (C++, Python, Lua, ...)
    • <leader>r for refactor commands (extract function/variable/block, inline variable)
  • lean.lua: Lean 4 theorem prover support via lean.nvim
    • Loads for *.lean files
  • typst.lua: live-preview for Typst documents via typst-preview.nvim
    • Opens the preview in the browser for typst files
  • 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>gd to open, or :DiffviewOpen in normal mode
  • butlr.lua: GitButler hunk navigation and actions via butlr.nvim
    • Only enabled inside a GitButler-managed repo (needs the but CLI)
    • <leader>b for Butler commands (navigate hunks, rub/assign, absorb, discard, undo)
Miscellaneous — autopairs, CSV, line notes, cloaking
  • autopairs.lua: automatically inserts closing brackets, quotes, etc.
  • csv.lua: a CSV viewer/editor using csvview.nvim.
    • <leader>cv toggles the aligned CSV display
  • haunt.lua: Line notes that do not affect the code source.
    • <leader>k for 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_ENV set)
    • <leader>a for agent commands
  • cloak.lua: Hiding environment variables.
    • :CloackDisable to see the variables' values.

Presets

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.

Extending it with your own config

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-config

Or take mine — mostly niche and experimental:

ln -s user-config.elwardi user-config

init.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
}

Plugin versions

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:

  1. :ConfigNews — fetches the remote, shows how many commits you are behind and a changelog
  2. git pull in the config directory
  3. :ConfigLockReset — moves your plugins to the versions pinned by this repo

:Lazy update moves you ahead of the pinned versions; :ConfigLockReset brings you back.

About

Minimal NeoVim configuration for day-to-day programming

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages