neovim: slice 4 — treesitter, C++ stack, UI polish + telescope extensions (#19) #48

Merged
rpickler merged 3 commits from issue-19-nixvim-slice-4-cpp-ui into main 2026-11-03 06:41:31 +00:00
Member

Slice 4 — the explicit list from comment 977, plus the two recommended telescope extensions from 929. Alloy is out everywhere (telescope and treesitter), per the same comments.

treesitter (plugins/treesitter.nix, import uncommented in plugins/default.nix)

The stub file was literally empty — which is why the import was commented out (an empty .nix is a valid but empty module). Rewritten against the nixvim rev pinned in flake.lock (453dc9c5): this rev targets the nvim-treesitter main branch via Neovim's native APIs — parsers come from Nix (all grammars by default; grammarPackages to trim), highlighting/indent are plain module options. indent is disabled for nix (nixd owns nix formatting; the indent queries only get in the way). Folding deliberately NOT enabled — nvim-ufo (slice 2) keeps foldexpr, and its provider selector automatically picks up treesitter fold ranges now that the parsers are installed.

ts-comments + ts-context-commentstring (plugins/treesitter.nix)

gc comments the right syntactic node, and the comment token follows the context (e.g. // inside C++ that itself sits in a block comment, -- for nix). ts-context-commentstring feeds ts-comments; the nixvim module wants treesitter enabled for it, which the file above now does.

UI polish (plugins/ui.nix)

  • dressing — single rounded float with completion/history for :input/:select (LSP rename, gitsigns, neogen prompts).
  • aerial — symbol outline sidebar; LSP backend when a client attaches, treesitter fallback. <leader>ao toggle, <leader>aO toggle+focus, Esc closes.
  • nvim-lightbulb + fastaction — 💡 sign-column marker when a code action exists at the cursor (autocmd enabled — without it the sign never appears), and code_action_fn wired to fastaction so the action pops as one-key letters. <leader>ca stays the plain native picker.

C++ stack (plugins/cpp.nix)

  • clangd with the Akari-style flags (--background-index --clang-tidy --header-insertion=iwyu), binary from Nix. Formatting stays manual — <leader>cf formats via clangd; no format-on-save, per standing rule.
  • clangd-extensions — AST browser, .h ↔ .cpp switching, richer inlay hints.
  • cmake LSP + cmake-tools — CMakeLists IntelliSense plus build/test-preset running (quickfix executor, terminal runner — no toggleterm dependency); :CMakeCommands.
  • Debugging — nvim-dap core (from slice 3) with its built-in gdb/MI executable adapter, gdb from Nix; c/cpp launch configs prompt for the executable and break at main. The slice-3 F5/F6/F7/F8 + <leader>du/<leader>dr keys drive it unchanged. cmake + gdb added to extraPackages.

Telescope extensions (plugins/telescope.nix)

fzf-native (compiled sorter — the big speed win on live_grep/find_files) and ui-select (telescope UI for vim.ui.select, with the codeactions specific-opt) — the two extensions telescope's README recommends, which were sitting commented-out in the file exactly as you left them. Nothing alloy-related anywhere in the config.

Overlap note: dressing and telescope-ui-select both style vim.ui.select. Both are self-contained blocks — if the LSP rename picker ends up not your taste, delete one of the two enable blocks and nothing else depends on it.

Verification

Verified against the nixvim rev pinned in flake.lock (453dc9c5) with real nix this time: full nix build of programs.nixvim.build.package for the sausage config (the home-manager nixvim module end-to-end — vim-pack-dir, wrapped neovim, generated init) exits 0, and the built package contains aerial.nvim, dressing.nvim, fastaction.nvim, nvim-lightbulb, ts-comments.nvim, nvim-ts-context-commentstring, clangd_extensions.nvim, cmake-tools.nvim, telescope-fzf-native.nvim, telescope-ui-select.nvim, with the clangd flags and gdb adapter in the generated init. One eval-caught fix included: clangd's cmd belongs under settings in the nixvim server modules (commit 2).

Closes #19

Slice 4 — the explicit list from comment 977, plus the two recommended telescope extensions from 929. Alloy is out everywhere (telescope and treesitter), per the same comments. ## treesitter (`plugins/treesitter.nix`, import uncommented in `plugins/default.nix`) The stub file was literally empty — which is why the import was commented out (an empty .nix is a valid but empty module). Rewritten against the nixvim rev pinned in `flake.lock` (`453dc9c5`): this rev targets the nvim-treesitter **main** branch via Neovim's native APIs — parsers come from Nix (all grammars by default; `grammarPackages` to trim), highlighting/indent are plain module options. `indent` is disabled for `nix` (nixd owns nix formatting; the indent queries only get in the way). Folding deliberately NOT enabled — nvim-ufo (slice 2) keeps `foldexpr`, and its provider selector automatically picks up treesitter fold ranges now that the parsers are installed. ## ts-comments + ts-context-commentstring (`plugins/treesitter.nix`) `gc` comments the right syntactic node, and the comment token follows the context (e.g. `//` inside C++ that itself sits in a block comment, `--` for nix). ts-context-commentstring feeds ts-comments; the nixvim module wants treesitter enabled for it, which the file above now does. ## UI polish (`plugins/ui.nix`) - **dressing** — single rounded float with completion/history for `:input`/`:select` (LSP rename, gitsigns, neogen prompts). - **aerial** — symbol outline sidebar; LSP backend when a client attaches, treesitter fallback. `<leader>ao` toggle, `<leader>aO` toggle+focus, `Esc` closes. - **nvim-lightbulb + fastaction** — 💡 sign-column marker when a code action exists at the cursor (autocmd enabled — without it the sign never appears), and `code_action_fn` wired to fastaction so the action pops as one-key letters. `<leader>ca` stays the plain native picker. ## C++ stack (`plugins/cpp.nix`) - **clangd** with the Akari-style flags (`--background-index --clang-tidy --header-insertion=iwyu`), binary from Nix. Formatting stays manual — `<leader>cf` formats via clangd; no format-on-save, per standing rule. - **clangd-extensions** — AST browser, `.h` ↔ `.cpp` switching, richer inlay hints. - **cmake** LSP + **cmake-tools** — CMakeLists IntelliSense plus build/test-preset running (quickfix executor, terminal runner — no toggleterm dependency); `:CMakeCommands`. - **Debugging** — nvim-dap core (from slice 3) with its built-in gdb/MI executable adapter, gdb from Nix; `c`/`cpp` launch configs prompt for the executable and break at `main`. The slice-3 F5/F6/F7/F8 + `<leader>du`/`<leader>dr` keys drive it unchanged. `cmake` + `gdb` added to `extraPackages`. ## Telescope extensions (`plugins/telescope.nix`) `fzf-native` (compiled sorter — the big speed win on live_grep/find_files) and `ui-select` (telescope UI for `vim.ui.select`, with the `codeactions` specific-opt) — the two extensions telescope's README recommends, which were sitting commented-out in the file exactly as you left them. Nothing alloy-related anywhere in the config. Overlap note: dressing and telescope-ui-select both style `vim.ui.select`. Both are self-contained blocks — if the LSP rename picker ends up not your taste, delete one of the two enable blocks and nothing else depends on it. ## Verification Verified against the nixvim rev pinned in `flake.lock` (`453dc9c5`) with real `nix` this time: full `nix build` of `programs.nixvim.build.package` for the `sausage` config (the home-manager nixvim module end-to-end — vim-pack-dir, wrapped neovim, generated init) exits 0, and the built package contains aerial.nvim, dressing.nvim, fastaction.nvim, nvim-lightbulb, ts-comments.nvim, nvim-ts-context-commentstring, clangd_extensions.nvim, cmake-tools.nvim, telescope-fzf-native.nvim, telescope-ui-select.nvim, with the clangd flags and gdb adapter in the generated init. One eval-caught fix included: clangd's `cmd` belongs under `settings` in the nixvim server modules (commit 2). Closes #19
- treesitter.nix: rewrite the empty stub for the nixvim main-branch module;
  highlight + indent on (nix indent disabled), folding left to nvim-ufo;
  add ts-comments + ts-context-commentstring; no alloy grammar.
- cpp.nix: clangd (background-index, clang-tidy, IWYU) with
  clangd-extensions, cmake LSP, cmake-tools, and gdb/MI dap launch
  configs for c/cpp reusing the slice-3 dap keymaps.
- ui.nix: dressing, aerial (outline), nvim-lightbulb + FastAction pair.
The two extensions telescope's README recommends, sitting commented-out in telescope.nix — comment 929 asked to 'turn on telescope with the two recommended extensions'. Alloy stays out per 'forget alloy' (929/977).
rpickler deleted branch issue-19-nixvim-slice-4-cpp-ui 2026-11-03 06:41:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
richardpickler.com/nixos!48
No description provided.