Configuration

Configuration #

Configuring visimp #

You can configure your visimp installation from neovim’s init.lua located under your $XDG_CONFIG_DIR/nvim:

require 'visimp' {
  -- my (empty) visimp configuration
}

Requiring the visimp script returns a “setup” function. This procedure is invoked by passing a description of your intended visimp configuration as parameter. In the example above, we are using an empty object ({}) as our configuration, so no layer is enabled, besides the default ones. If you want to enable one, use its name as a new key (whose value will be an empty object for now). The available layers are listed at the bottom of this page. The following configuration enables the autopairs, gitsigns, and outline layers:

require 'visimp' {
  autopairs = {},
  gitsigns = {},
  outline = {}
}

To disable a layer, you can either remove it from your configuration or use false as its value. The latter is needed when the layer is enabled by default:

require 'visimp' {
  gitsigns = false, -- "gitsigns" is disabled: you may as well remove its entry
  
  lsp = false,      -- this line, on the contrary, is required as the layer
                    -- would be enabled by default
}

So far, we’ve stuck to empty objects as values for our enabled layers. These objects actually represent your configuration for that specific layer. Usually, each key is one of the settings available for the layer in question:

require 'visimp' {
  defaults = {             -- The "defaults" layer is enabled and should use:
    foldmethod = 'marker', -- - "marker" as its "foldmethod"
    tabsize = 4            -- - 4 as its "tabsize"
  }
}

When a setting isn’t specified, its default value is used, and every setting has a default value, so {} is always an acceptable configuration. Actually, some layers accept a list of values instead of a key-value pairs configuration. The main exception is the languages meta-layer:

require 'visimp' {
  languages = { -- accepts a list of languages for which support is needed.
    'c',
    'go',
    'latex',
    'rust'
  }
}

Available Layers #

Standard Layers #

Before configuring a new standard layer, you’re advised to take a look at its reference page. You can look it up in the following table.

Layer nameShort description
autopairsAutomatic completion of {, (, and HTML tags
bindsCustom bindings for native Vim commands
blanklineIndentation guides
cmpCompletion engine
colorizerColor highlighter
commentAutomatic (un)commenting support
defaultsCustomizable sane defaults
diagnosticsPretty list of diagnostics, quickfixes, and more
fugitiveGit wrapper
gitsignsGit code decorations
greeterCustom Nvim greeter
iconsAdds file type icons
languagesEnable language layers
lspManager for Neovim’s LSP client and LSP servers
lspformatFormatting on save via LSP
lspsignatureFunction signatures as you type
ltexGrammar checking via LanguageTool
nvimtreeFile explorer tree
outlineBuffer outline as a tree-like view of symbols
rainbowRainbow parenthesis via Tree-sitter
snippetCode snippets engine
statuslineCustomizable status line
telescopeFuzzy finder and related features
themeInstall and enable classic vim themes
treesitterSyntax highlighting
whichkeyPopups for key bindings suggestions
zenDistraction-free “zen” mode

Language layers #

Layer nameLanguage
agdaAgda
amplAMPL
bashBash
cC/C++
coqCoq
csharpC#
cssCSS
dartDart
gleamGleam
goGo
haskellHaskell
hclHCL
htmlHTML
idrisIdris
javaJava
javascriptJavaScript/TypeScript
jsonJSON
latexLaTeX\LaTeX
leanLean
luaLua
markdownMarkdown
ocamlOCaml
phpPHP
prolog(SWI-/GNU-/…)Prolog
pythonPython
rustRust
svelteSvelte
swiftSwift
tomlTOML
typstTypst
vueVue