Skip to content
Edit this page

Configuration

Everything of yours lives in the user/ folder of the config (for example ~/.config/nvim/user/). lua/ is CodeArt's own code and you never edit it. Git ignores user/, so :CodeArtUpdate never touches or conflicts with it, and you can keep the folder in your dotfiles.

File What it is
user/settings.lua Your settings, merged over the defaults (this page). :CodeArtConfig opens it and creates it from the example if it is missing
user/plugins/*.lua lazy.nvim specs: new plugins, or changes to the built-in ones
user/languages/*.lua Your own language packs, or a replacement for a built-in pack
user/keymaps.lua Key maps, run after CodeArt's maps and plugins are set up
user/autocmds.lua Autocommands, run after user/keymaps.lua
user/backup/ The originals the 2.8 move kept (see below), and nothing else of CodeArt's

CodeArt 2.2 – 2.7 kept the settings in codeart_settings.lua and packs in languages/ next to init.lua. 2.8 moves them into user/ on its first start, keeps the originals in user/backup/ and tells you once; see Migrating.

:CodeArtSetup writes the common choices (languages, theme, picker, file tree, optional plugins, format on save) to user/settings.lua for you; see Setup wizard.

  • user/settings.lua is created from user_settings.example.lua on first start.
  • It is deep-merged over the built-in defaults in lua/codeart/defaults.lua (vim.tbl_deep_extend("force", ...)), so it only needs the values you change. A partial file is fine.
  • Nested tables (disable_plugins, config.*) merge key by key. Lists (additional_plugins, extra_which_keys) and functions (config.lsp, config.other_configs) replace the default.
  • Keys CodeArt doesn't know are ignored, and a warning after startup lists them, with a "did you mean" suggestion for typos and the new name for settings renamed in 2.0 (for example config.cmp → config.blink). Old names that 2.3 still reads (see below) only get their one-time notice. What goes inside a plugin's options table (config.telescope, config.blink, ...), additional_plugins, extra_which_keys and config.lsp is passed through and never checked.
  • To use CodeArt's helpers in this file, require them by their codeart. names, for example require("codeart.utils"). The old top-level names (utils, user_settings, plugins.…) were removed in 2.5; see Migrating.
  • Do not edit lua/user_settings.lua or lua/codeart/defaults.lua. The old lua/user_settings.lua stays in the repo unchanged until v3.0 only so git pull keeps working for people who edited it.

Coming from CodeArt 2.1 with an edited lua/user_settings.lua

CodeArt notices the edits and asks whether to copy them into user/settings.lua. Until you answer, your old file keeps being used. If you say no, CodeArt starts from the example and does not ask again; run :CodeArtMigrateSettings any time to copy the edits later (an existing user/settings.lua is backed up first). After migrating, restore the tracked file with git checkout -- lua/user_settings.lua.

The examples below use the same M table layout as user/settings.lua.

Disable plugins

Set flags under M.disable_plugins:

M.disable_plugins = {
  catppuccin = true,  -- disabled
  neo_tree = false,   -- enabled
}

mkdir = true turns off the built-in autocmd that creates missing parent directories when you save a file (e.g. :w new/dir/file.lua). It replaced mkdir.nvim in 2.3, with the same flag and behavior.

snacks = true turns off snacks.nvim, which since 2.3 provides zen mode (<leader>bz) and buffer zoom (<leader>bm) in place of true-zen.nvim, and optional smooth scrolling in place of neoscroll.nvim. Zen is on by default; smooth scrolling is off (disable_plugins.smooth_scroll = true). disable_plugins.truezen is read as disable_plugins.snacks. disable_plugins.neoscroll is read as disable_plugins.smooth_scroll.

smooth_scroll = false turns on snacks.nvim smooth scrolling. Options live under config.snacks.scroll (including hide_cursor, which is on by default and needs termguicolors).

blink.cmp's signature help is on by default (it replaced lsp_signature.nvim in 2.3). <leader>ls still shows vim.lsp.buf.signature_help(). <C-k> toggles the floating signature in insert mode and takes over i_CTRL-K digraphs while blink is enabled. The end-of-line parameter hint is also on by default (disable_plugins.signature_hint = true turns it off). Options live under config.blink.signature and config.signature_hint (prefix, inline, hl). disable_plugins.lsp_signature is read as disable_plugins.signature_hint, and if it was true blink signature is also turned off.

Split resizing is built in (it replaced vim-resize in 2.3). The default keys are <C-Left>, <C-Right>, <C-Up> and <C-Down> in normal and terminal mode, so H, J, K and L are stock Vim motions. On macOS, Ctrl+Left/Right switch Spaces by default; set config.resize.keys = "shift_hjkl" to restore the old Shift+h/j/k/l maps. disable_plugins.resize = true turns the maps off. disable_plugins.vim_resize is read as disable_plugins.resize. Options live under config.resize (keys, step_h, step_v).

Plugin options (M.config)

Most plugin setups deep-merge your table into CodeArt defaults (vim.tbl_deep_extend("force", ...)):

  • You can override individual nested keys without wiping siblings
  • To replace a whole nested section, pass a full table for that section
  • For a totally custom plugin setup: disable the plugin and add your own via additional_plugins

Picker

The find maps (<leader>f…), the git history/branch/status maps, the colorscheme pickers, the diagnostics fallback and the dashboard buttons all open the picker chosen by config.picker:

M.config.picker = "snacks" -- or "telescope" (default)
  • "telescope": telescope.nvim, exactly as before. Options go in config.telescope.
  • "snacks": the picker module of snacks.nvim. telescope.nvim, telescope-fzf-native and telescope_find_directories are then not loaded. Options go in config.snacks.picker.

vim.ui.select menus (LSP code actions, CodeArt's settings migration question, ...) also use the picker:

  • with "snacks", the snacks picker's select menu (loaded on first use). Set config.snacks.picker.ui_select = false to keep Neovim's built-in menu.
  • with "telescope", telescope-ui-select.nvim if you added it to additional_plugins (CodeArt doesn't ship it); otherwise Neovim's built-in menu stays.

Any other value, or "snacks" with disable_plugins.snacks = true, shows a warning and uses Telescope. :checkhealth codeart shows which picker is active.

Conform (format)

The defaults enable format-on-save with LSP fallback. Formatters stay opt-in:

M.config.conform = {
  format_on_save = {
    timeout_ms = 500,
    lsp_fallback = true,
  },
  -- formatters_by_ft = {
  --   lua = { "stylua" },
  --   python = { "black" },
  -- },
}

Remove or edit config.conform to change or disable format-on-save. Manual format: <leader>r (conform + LSP fallback, or LSP only if conform is disabled).

Lint

Opt-in only (no default linters):

M.config.lint = {
  linters_by_ft = {
    python = { "flake8" },
    sh = { "shellcheck" },
  },
}

Treesitter parsers

Opt-in only (CodeArt ships no default parsers):

M.config.treesitter = {
  ensure_installed = { "lua", "vim", "python" },
}

Or use :TSInstall <language> — see LSP, formatting and Treesitter.

LSP

M.config.lsp = function()
  -- vim.lsp.config("lua_ls", {})
  -- vim.lsp.enable("lua_ls")
end

Colorscheme

M.config.colorscheme = "tokyonight"

config.colorscheme (new in 2.5, also set by :CodeArtSetup) is applied after config.other_configs. Leave it unset to pick the theme in other_configs as before:

M.config.other_configs = function()
  vim.cmd("colorscheme enfocado")
end

Optional themes load via Lazy colorscheme = "..." triggers (e.g. :colorscheme tokyonight).

Bundled themes: enfocado (default), tokyonight (+ -night, -storm, -moon, -day), nightfly, moonfly, nordic, onedark and catppuccin (disabled by default). Since 2.3, nordic (nordic.nvim) replaces nord; colorscheme nord still works and loads nordic with a one-time notice, and disable_plugins.nord is read as disable_plugins.nordic.

Inlay hints and code lens

Both are on by default and turned on for each buffer whose language server supports them. The lua, go and web packs ask lua_ls, gopls and vtsls to send hints, which those servers do not do on their own.

M.config = {
  inlay_hints = { enabled = false }, -- <leader>lH still turns them on in a buffer
  code_lens = { enabled = false },   -- <leader>lC still turns them on in a buffer
}

Sessions

Sessions are off by default. With them on, CodeArt saves the open files, windows and tabs for the working directory when you quit (only when a file is open), using resession.nvim. A session is never loaded on its own: nvim still opens the dashboard, and you load the session when you want it.

M.config = {
  sessions = { enabled = true },
}
Keys Command What it does
<leader>sl :CodeArtSession load Load the session for this folder
<leader>ss :CodeArtSession save Save it now
<leader>sp :CodeArtSession pick Pick any saved session
<leader>sd :CodeArtSession delete Delete the session for this folder

Sessions are stored in stdpath("data")/dirsession/. resession.nvim options go in config.resession. :CodeArtSetup can turn sessions on (in the optional plugins question).

Projects

<leader>fp or :CodeArtProjects lists your recent projects: the git roots of your recent files, and the folders that have a saved session. Pick one and CodeArt changes to that folder, then loads its session (when sessions are on and it has one) or opens the file picker in it. The list uses your picker (config.picker) and needs no extra plugin.

Running and building

<leader>R and :CodeArtRun / :CodeArtBuild run your project's tasks (Makefile targets, package.json scripts, Cargo, Go, Just, mise, .vscode/tasks.json) with overseer.nvim. On by default and loaded on first use; disable_plugins.overseer = true turns it off, and overseer options go in config.overseer. See Running and building.

Extras

Opt-in groups of plugins, all off by default:

M.config = {
  extras = {
    editing = true, -- flash on s / S, treesitter text objects, grug-far on <leader>fr
    git = true,     -- diffview-plus: <leader>gD, <leader>gH, <leader>gX
  },
}

See Extras for the keys and how to drop one plugin from a group.

Your plugins (user/plugins/)

Each .lua file in user/plugins/ returns one lazy.nvim spec or a list of them. CodeArt loads them in file name order, after its own plugins:

-- user/plugins/harpoon.lua
return {
  "ThePrimeagen/harpoon",
  branch = "harpoon2",
  dependencies = { "nvim-lua/plenary.nvim" },
  keys = {
    { "<leader>ha", function() require("harpoon"):list():add() end, desc = "Harpoon add" },
  },
}

A spec for a plugin CodeArt already has is merged into CodeArt's by lazy.nvim, so you can change a built-in plugin without forking CodeArt:

-- user/plugins/overrides.lua
return {
  { "folke/tokyonight.nvim", enabled = false },            -- turn a plugin off
  { "lewis6991/gitsigns.nvim", event = "VeryLazy" },        -- load it later
  { "folke/which-key.nvim", opts = { preset = "modern" } }, -- options for a plugin set up with `opts`
}

enabled, event, keys, dependencies and the other loading fields merge as lazy.nvim documents. A config function replaces CodeArt's setup of that plugin. For the plugins CodeArt sets up itself, config.<plugin> in user/settings.lua (see Plugin options) and disable_plugins are usually simpler. A file that fails to load or returns something that is not a spec is reported once and skipped; :checkhealth codeart lists it.

Your key maps and autocmds

user/keymaps.lua and then user/autocmds.lua run last, after CodeArt's own key maps, plugins and theme, so a map there replaces CodeArt's:

-- user/keymaps.lua
vim.keymap.set("n", "<C-s>", "<Cmd>write<CR>", { desc = "Save" })
vim.keymap.set("n", "<leader>/", "<Cmd>Telescope live_grep<CR>", { desc = "Grep" })
-- user/autocmds.lua
vim.api.nvim_create_autocmd("FileType", {
  group = vim.api.nvim_create_augroup("MyFiletypes", {}),
  pattern = "markdown",
  callback = function()
    vim.opt_local.wrap = true
  end,
})

Both are optional. config.other_configs in user/settings.lua still works; it runs before the colorscheme is applied, these two after it.

Extra plugins

M.additional_plugins in user/settings.lua accepts lazy.nvim specs too (string or table). It works as before; user/plugins/ is easier to keep tidy:

M.additional_plugins = {
  {
    "Mofiqul/vscode.nvim",
    colorscheme = "vscode",
  },
}

Extra which-key maps

which-key v3 specs via utils.wk_add:

local wk_add = require("codeart.utils").wk_add

wk_add({
  { "<leader>ff", ":Telescope find_files<CR>", desc = "Find File" },
}, { mode = "n" }, M.extra_which_keys)

Reference

All defaults live in lua/codeart/defaults.lua; user_settings.example.lua lists the same keys, commented out.

M.disable_plugins

true turns a plugin or built-in feature off, false turns it on.

Flag Default What it controls
plenary false plenary.nvim (library used by Telescope, neo-tree, todo-comments, ...)
tokyonight false tokyonight.nvim theme
nightfly false vim-nightfly-guicolors theme
moonfly false vim-moonfly-colors theme
nordic false nordic.nvim theme (replaced nord in 2.3)
onedark false onedark.nvim theme
catppuccin true catppuccin theme (off by default)
nvim_enfocado false nvim-enfocado theme (the default colorscheme)
nvim_dap false nvim-dap (debugging)
nvim_dap_ui false nvim-dap-ui
mason_nvim_dap false mason-nvim-dap.nvim
telescope_fzf_native false telescope-fzf-native.nvim
telescope_find_directories false telescope_find_directories (<leader>fd)
telescope false telescope.nvim
scrollview false nvim-scrollview (scrollbar)
smooth_scroll true snacks.nvim smooth scrolling (off by default)
blink_cmp false blink.cmp (completion and signature help)
luasnip false LuaSnip
friendly_snippets false friendly-snippets
nvim_web_devicons false nvim-web-devicons
lualine false lualine.nvim (status line)
nvim_bufferline false bufferline.nvim
indent_blankline false indent-blankline.nvim
better_escape true better-escape.nvim (off by default)
snacks false snacks.nvim: zen mode and zoom (also needed for smooth scrolling)
neo_tree false neo-tree.nvim
treesitter false nvim-treesitter
nvim_colorizer false nvim-colorizer.lua
dashboard false dashboard-nvim
nvim_lspconfig false nvim-lspconfig
mason false mason.nvim
mason_lspconfig false mason-lspconfig.nvim
conform false conform.nvim (formatting)
lint false nvim-lint
lspsaga true lspsaga.nvim (off by default since 2.3; the LSP maps then use Neovim's built-in functions). false turns it back on
outline false outline.nvim
trouble false trouble.nvim
surround false nvim-surround
signature_hint false Built-in end-of-line hint for the active LSP parameter
toggleterm false toggleterm.nvim
fugitive false vim-fugitive
gitsigns false gitsigns.nvim
autopairs false nvim-autopairs
nvim_ts_autotag false nvim-ts-autotag
todo_comments false todo-comments.nvim
which_key false which-key.nvim
mkdir false Built-in: create missing parent directories on save
comment false Built-in comment keymaps: gco, gcO, gcA, gb, gbc, <leader>/
ts_comments false ts-comments.nvim
vim_matchup false vim-matchup
resize false Built-in edge-aware split resizing
neotest false neotest and the language packs' test adapters (<leader>T, :CodeArtTest; see Testing)
lsp_file_operations false nvim-lsp-file-operations: renaming or moving a file in neo-tree updates imports through the language server
overseer false overseer.nvim: run and build tasks (<leader>R, :CodeArtRun, :CodeArtBuild; see Running and building)
schemastore false SchemaStore.nvim: JSON schemas for jsonls when the web pack is on
flash false flash.nvim, when the editing extra is on (s / S; see Extras)
treesitter_textobjects false nvim-treesitter-textobjects, when the editing extra is on
grug_far false grug-far.nvim, when the editing extra is on (<leader>fr)
diffview false diffview-plus.nvim, when the git extra is on (<leader>gD, <leader>gH, <leader>gX)

Old flag names from before 2.3 (nord, truezen, neoscroll, lsp_signature, vim_resize, ts_context_commentstring) are still read and mapped onto the new ones with a one-time notice. See the CHANGELOG.

M.config

Tables under M.config.<key> are deep-merged into that plugin's setup options, so use the plugin's own option names.

Key Used by
better_escape better-escape.nvim
blink blink.cmp (including signature for the floating signature window)
bufferline bufferline.nvim
catppuccin catppuccin
colorizer nvim-colorizer.lua
conform conform.nvim (ships with format_on_save = { timeout_ms = 500, lsp_fallback = true })
dapui nvim-dap-ui
dashboard dashboard-nvim
diffview diffview-plus.nvim (git extra)
flash flash.nvim (editing extra; CodeArt turns its f/t and / modes off)
gitsigns gitsigns.nvim
grug_far grug-far.nvim (editing extra)
indent_blankline indent-blankline.nvim
lint nvim-lint (linters_by_ft, opt-in)
lspsaga lspsaga.nvim
lualine lualine.nvim
mason mason.nvim
mason_lspconfig mason-lspconfig.nvim (default automatic_enable = true)
mason_dap_config mason-nvim-dap.nvim
neotest neotest (adapter_options["<module>"] for a pack's adapter, adapters to add your own; see Testing)
neo_tree neo-tree.nvim
nvim_ts_autotag nvim-ts-autotag
nvim_web_devicons nvim-web-devicons
onedark onedark.nvim
outline outline.nvim
overseer overseer.nvim (the task list opens at the bottom)
resession resession.nvim (used when sessions are on)
rustaceanvim rustaceanvim (the rust pack; see Language packs)
scrollview nvim-scrollview
snacks snacks.nvim (zen, scroll; see below)
surround nvim-surround
telescope telescope.nvim
todo_comments todo-comments.nvim
toggleterm toggleterm.nvim
tokyonight tokyonight.nvim
treesitter ensure_installed: parsers to install on startup (opt-in)
treesitter_textobjects nvim-treesitter-textobjects (editing extra)
trouble trouble.nvim
ts_comments ts-comments.nvim
vim_matchup vim-matchup
which_key which-key.nvim
user_lualine_style Status line separators: a preset number from lua/codeart/plugins/lualine/lualine.lua, or a { section, component } pair of separator tables

These keys are CodeArt's own:

Key Default Meaning
colorscheme unset Theme applied after other_configs, for example "tokyonight". Unset: the theme set in other_configs is kept
picker "telescope" Picker for the find, git, colorscheme and diagnostics maps and the dashboard: "telescope" or "snacks" (see Picker)
lsp empty function Runs during LSP setup; call vim.lsp.config() / vim.lsp.enable() here
other_configs vim.cmd("colorscheme enfocado") Runs last, after everything else has loaded
signature_hint.enabled true Show the end-of-line parameter hint
signature_hint.prefix "" Text shown before the parameter
signature_hint.inline false Show the hint at the cursor instead of at the end of the line
signature_hint.hl "LspSignatureActiveParameter" Highlight group for the hint
resize.keys "ctrl_arrows" "ctrl_arrows" (<C-Left/Right/Up/Down>) or "shift_hjkl" (the pre-2.3 H/J/K/L maps)
resize.step_h 3 Columns per horizontal resize
resize.step_v 1 Lines per vertical resize
inlay_hints.enabled true Show inlay hints (types, parameter names) for servers that support them. <leader>lH toggles them in a buffer
code_lens.enabled true Show code lens for servers that send it. <leader>lc runs the one on the cursor line, <leader>lC toggles them in a buffer
sessions.enabled false Save the open files, windows and tabs per folder when you quit (see Sessions)
extras.editing false flash.nvim on s / S, treesitter text objects and moves, grug-far on <leader>fr (see Extras)
extras.git false diffview-plus.nvim on <leader>gD, <leader>gH, <leader>gX (see Extras)
statusline_hide dashboard, alpha, TelescopePrompt, TelescopeResults, lazy, lspinfo, mason, neo-tree, neo-tree-popup Filetypes whose windows hide the global statusline. Setting it replaces the whole list
cursorline_hide the same plus toggleterm, dap-repl, dapui_console Filetypes whose windows hide the cursorline. Setting it replaces the whole list
snacks.scroll.hide_cursor true Hide the cursor while a smooth-scroll animation runs (needs termguicolors)
snacks.scroll.animate_repeat { delay = 300, duration = { step = 5, total = 15 } } Shorter animation for held or repeated scroll keys

Commands

Command What it does
:CodeArtSetup Questions for languages, theme (live preview), picker, file tree, optional plugins and format on save, then writes user/settings.lua after you confirm (the old file is kept as .bak). See Setup wizard
:CodeArtUpdate git fetch and fast-forward the config folder, then install the plugin versions in lazy-lock.json, upgrade Mason tools and run :TSUpdate, and show a summary. Stops if tracked files have local changes. See Update
:CodeArtUpdate check Show what an update would bring (version, commits, BREAKING lines) without changing anything
:CodeArtUpdate stash Update even with local changes: they are saved (patch in stdpath("state")/codeart/backups/ and a git stash) and put back afterwards
:CodeArtUpdate rollback Go back to the version before one of the last three updates, after you confirm. Refused on a dirty tree. See Update
:checkhealth codeart Check the Neovim version, your settings file (loads, unknown keys, wrong value types, pending migration), the runtimes your language packs need, external tools, clipboard and Nerd Font, with install commands for your OS. See Troubleshooting
:CodeArtConfig Open user/settings.lua, creating it from user_settings.example.lua if it is missing. If an edited lua/user_settings.lua is still in use, it first asks whether to copy those edits
:CodeArtMigrateSettings Move a 2.7 codeart_settings.lua and languages/ into user/ (done on start too), or copy edits from the legacy lua/user_settings.lua into user/settings.lua
:CodeArtTransparent Clear the background of the main highlight groups (transparent terminal background)
:CodeArtTest [nearest\|file\|project\|last\|debug\|summary\|output\|panel\|watch\|stop] Run tests with neotest (default: the nearest test). See Testing
:CodeArtProjects Pick a recent project: change to its folder, then load its session or find a file. See Projects
:CodeArtSession [load\|save\|pick\|delete] Sessions for the current folder (default: load). Only when config.sessions.enabled is true
:CodeArtRun [last\|pick\|build\|list\|quickfix\|stop] Run a project task (default: rerun the last one, or pick one). See Running and building
:CodeArtBuild Run the project's build task