Skip to content
Edit this page

Extras

Extras are small groups of plugins that are off by default. A default CodeArt install looks and behaves the same whether you have read this page or not. Turn a group on and you get its plugins and keys; every plugin in it is lazy-loaded on its keys or commands, so an extra adds nothing to startup until you use it.

M.config = {
  extras = {
    editing = true, -- flash, treesitter text objects, grug-far
    git = true,     -- diffview-plus
    ai = true,      -- codecompanion (see AI)
  },
}

:CodeArtSetup offers all three in the optional plugins question. :checkhealth codeart shows which extras are on and which of their plugins are installed.

Editing extra

config.extras.editing = true

Plugin What you get
flash.nvim s jumps anywhere on screen: type one or two characters, then the label. S selects a Treesitter node (a function, a block, an argument). Both work in normal, visual and operator-pending mode: in visual mode s extends the selection to the label, and gUs + label uppercases up to it. (ds, cs and ys stay nvim-surround's.)
nvim-treesitter-textobjects Text objects: af / if (function), ac / ic (class), aa / ia (parameter), for example dif, vac, cia. Moves: ]f / [f (next / previous function), ]c / [c (next / previous class).
grug-far.nvim <leader>fr opens search and replace for the whole project in a buffer, with ripgrep. :GrugFar does the same.

s and S

With the editing extra on, s and S are flash. Vim's own s (delete a character and insert) is still cl, and S is still cc. f, t, F, T and / are not changed: flash's modes for them are off. Turn them on in config.flash if you want them (modes = { char = { enabled = true } }).

In diff mode (:Gvdiffsplit, Diffview), ]c and [c keep moving between changes, as Vim does.

Git extra

config.extras.git = true

diffview-plus.nvim is the maintained fork of diffview.nvim (the original has not had a commit since June 2024). It has the same commands (:DiffviewOpen, :DiffviewFileHistory, ...) and the same diffview Lua module.

Keys What it does
<leader>gD Open a tab with every change in the repository, side by side, with a file panel
<leader>gH History of the current file, one commit at a time
<leader>gX Close Diffview

During a merge or rebase with conflicts, :DiffviewOpen shows a 3-way merge view (yours, the result, theirs). The other git tools stay as they are: gitsigns (<leader>gd diffs this file, hunks on <leader>g), vim-fugitive (:Git) and lazygit (<leader>tl).

AI extra

config.extras.ai = true

CodeCompanion: a chat buffer on <leader>aa (in visual mode it adds the selection) and inline edits on <leader>ai, with the LLM you set in config.codecompanion, including a local model through Ollama. See AI for choosing the LLM.

Turning one plugin off

Each plugin in an extra also has a disable_plugins flag. true drops that plugin while the rest of the extra stays on:

M.config = { extras = { editing = true } }
M.disable_plugins = {
  flash = true, -- keep text objects and grug-far, leave s / S alone
}
Extra Flags
editing flash, treesitter_textobjects, grug_far
git diffview
ai codecompanion

Plugin options

Options are merged into each plugin's setup: config.flash, config.treesitter_textobjects, config.grug_far, config.diffview and config.codecompanion.

M.config = {
  extras = { git = true },
  diffview = {
    view = { merge_tool = { layout = "diff3_mixed" } },
  },
}

Not in the extras

People asked about these. They work fine as your own plugins (see Extra plugins):

  • neogit: a Magit-style git interface. CodeArt already has lazygit and fugitive for that; neogit can use diffview-plus for its diffs.
  • codediff.nvim: a VS Code-style diff viewer. Young and downloads a compiled binary.
  • Other AI plugins (copilot.lua, claudecode.nvim): recipes in AI.