Skip to content

About

Neovim Config

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

94 Commits

Folders and files

Repository files navigation

Neovim Config

A personalized Neovim setup configured in Lua. This configuration is built around lazy.nvim for plugin management and aims for a modern and efficient development experience.

📖 Documentation

  • Cheatsheet: A comprehensive list of all keybindings, motions, and shortcuts.
  • Plugin Inventory: All plugins with purpose and rationale.
  • Project Overview: Details about the project structure, technologies, and conventions.

Features

  • Plugin Manager: Uses lazy.nvim for fast, declarative plugin management.
  • Completion: High-performance autocompletion with blink.cmp.
  • Snippets: Ready-to-use snippets via friendly-snippets.
  • Fast Fuzzy Finding: telescope.nvim for finding files, buffers, and grep.
  • File Explorer: nvim-tree.lua provided as a floating explorer.
  • Syntax & Highlighting: nvim-treesitter for robust parsing.
  • AI Assistance: codecompanion.nvim (Gemini CLI) and copilot.lua.
  • LSP: Configured via mason.nvim. Includes the "Modern Stack" for Python (basedpyright and ruff, plus pylsp running only the pylsp-rope plugin for extract/inline refactorings) and clangd for C/C++.
  • Formatting: Format-on-save with conform.nvim (Ruff for Python, clang-format for C/C++).
  • Linting: Lint-on-save with nvim-lint (MyPy; Ruff diagnostics come from the Ruff LSP server).
  • Python: Easy virtual environment switching with venv-selector.nvim, plus templates via esqueleto.nvim.
  • C/C++: clangd LSP, clang-format, CMake integration via cmake-tools.nvim, and debugging with codelldb/gdb.
  • Task Runner: Manage and run tasks (compiler, linter, etc.) with overseer.nvim.
  • Editing Helpers: Auto-pairs with nvim-autopairs, surround editing with nvim-surround, and comment toggling with Comment.nvim.
  • Refactoring: Extract/inline function and variable via refactoring.nvim (treesitter-based, works across C/C++, Python and Lua).
  • Text Objects: Function, class and parameter text objects and function motions via nvim-treesitter-textobjects.
  • Git: Hunk signs and inline git actions via gitsigns.nvim.
  • Discoverability: On-demand keybinding hints with which-key.nvim.
  • Clipboard: Default yank/paste uses the system clipboard (clipboard=unnamedplus).
  • Yank Feedback: Yanked text briefly highlights to confirm copy actions.
  • UI: Catppuccin Mocha theme and lualine.nvim statusline.

Installation

  1. Backup your existing configuration:

    mv ~/.config/nvim ~/.config/nvim.bak
  2. Clone this repository:

    git clone https://github.com/grimmy0/nvim-config ~/.config/nvim
  3. Start Neovim: The plugin manager (lazy.nvim) will automatically install itself and all plugins on the first start.

  4. Clipboard provider (Linux/macOS): This config enables unnamedplus, so install a system clipboard tool for your platform (for example wl-copy/wl-paste, xclip, or pbcopy/pbpaste).

  5. tree-sitter CLI (>= 0.26.1): Needed by :TSUpdate to build parsers. Distro packages are often older; a current binary in ~/.local/bin (installed here: 0.27.1; the previous 0.26.11 binary is kept in ~/.local/opt/tree-sitter-0.26.11/) takes precedence.

C/C++

  • Mason installs clangd, clang-format, and codelldb automatically on the first start.
  • gdb is not available through Mason. Install it from your distro (sudo dnf install gdb on Fedora) if you want the gdb launch/attach configurations — they stay hidden while gdb is absent.
  • clangd needs a compile_commands.json. cmake-tools.nvim generates one (-DCMAKE_EXPORT_COMPILE_COMMANDS=1) and soft-links it to the project root. For non-CMake projects, generate it yourself (for example bear -- make) or add a compile_flags.txt.
  • Per-project clangd tuning goes in a .clangd file; per-project formatting style in .clang-format.
  • Missing-include fixes come from ~/.config/clangd/config.yaml (Diagnostics.MissingIncludes: Strict), which lives outside this repo because clangd has no command-line flag for it. Without that setting clangd only adds headers when you accept a completion, so a pasted or fully typed symbol yields no fix.
  • clangd has no "create function from usage" action; it only generates a definition from an existing declaration (Add definition, Define outline). Use Copilot or CodeCompanion for generate-from-usage.

Keybindings

The <leader> key is set to space. For a full list of commands, see the CHEATSHEET.md.

Keybinding Action
<leader>e Toggle file explorer (NvimTree)
<leader>ff Find files (Telescope)
<leader>fg Live grep (Telescope)
<leader>cc AI Chat (CodeCompanion)
<leader>t Toggle Terminal (ToggleTerm)
<leader>vs Select VirtualEnv (VenvSelector)
<leader>or Run Task (Overseer)
<leader>mb Build CMake target (CMakeBuild)
gd Go to definition (LSP)
<leader>a Switch source/header (C/C++)
<F5> Debug: Run/Continue (DAP)

Plugin Management

This configuration uses lazy.nvim.

  • :Lazy - Open the manager UI.
  • :Lazy sync - Sync and update plugins.

Maintenance

Neovim install location

Neovim 0.12.6 is installed as a user-local tarball at ~/.local/opt/nvim-0.12.6/, exposed through the symlink ~/.local/bin/nvim. The previous 0.12.4 tarball is kept beside it in ~/.local/opt/nvim-0.12.4/; repoint the symlink there to roll back one release. Fedora 43 packages only 0.11.x, and the dnf-managed /usr/bin/nvim is left untouched — ~/.local/bin simply precedes /usr/bin on PATH. To roll back, delete the symlink and the older nvim takes over again. To upgrade, unpack the new tarball beside the old one and repoint the symlink.

Deprecated-API shims (lua/compat.lua)

Neovim is removing two long-deprecated APIs: vim.tbl_islist (removal target 0.12) and the table form of vim.validate (removal target 0.13). lua/compat.lua loads before plugins and shims both, keeping sessions quiet today and working the day the APIs disappear. Verified on Neovim 0.12.6: vim.tbl_islist, vim.tbl_flatten, vim.validate, vim.loop and vim.highlight.on_yank all still exist, and the config starts with no deprecation warnings, so the shims remain in place for now.

As of August 2026 these installed plugins still call the old APIs and need the shim:

  • vim.tbl_islist: codecompanion.nvim, lazy.nvim, mason.nvim, noice.nvim, nui.nvim, nvim-dap, plenary.nvim
  • table-form vim.validate: esqueleto.nvim, gitsigns.nvim, nvim-dap-ui, nvim-notify, toggleterm.nvim

Retirement condition — after any :Lazy sync, run:

grep -rl 'tbl_islist' ~/.local/share/nvim/lazy/*/lua
grep -rlE 'vim\.validate\(\{' ~/.local/share/nvim/lazy/*/lua

When both come back empty, delete lua/compat.lua and the pcall(require, 'compat') line in init.lua.

Pinned versions

  • nvim-treesitter is no longer pinned. The pin existed only because the main branch dropped Neovim 0.11 support in Apr 2026; Neovim 0.12 is now installed, so the plugin tracks main again.

clangd_extensions.nvim is intentionally absent

Everything that plugin used to add is native now: inlay hints via vim.lsp.inlay_hint (0.10), type hierarchy via vim.lsp.buf.typehierarchy (0.11), and :LspClangdSwitchSourceHeader / :LspClangdShowSymbolInfo shipped by nvim-lspconfig. Installing it would only duplicate those, so it is left out.

Known health-check quirks (safe to ignore)

  • :checkhealth blink.cmp always warns "Some providers may show up as disabled" — the check emits it unconditionally.
  • :checkhealth copilot warns "Suggestions disabled in configuration" — blink-cmp-copilot requires copilot.lua's suggestion module off, since Copilot items come through blink.cmp instead.
  • :checkhealth which-key reports gc/gcc, gb/gbc, ys/yss and yS/ySS as overlapping — every operator with a linewise variant looks like that (Neovim's built-in gc would too); timeoutlen only applies when you pause after the operator.

Cleanup checklist

  • Neovim 0.12+ lands: unpin nvim-treesitter — done, running 0.12.6
  • After each plugin sync: re-run the compat greps; retire lua/compat.lua when both are empty
  • Optional: upstream a vim.validate migration PR to esqueleto.nvim (the smallest of the twelve shim dependents)

About

Neovim Config

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages