Skip to content

Latest commit

 

History

History
141 lines (123 loc) · 6.85 KB

CONFIG.md

File metadata and controls

141 lines (123 loc) · 6.85 KB

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 name Short description
autopairs Automatic completion of {, (, and HTML tags
binds Custom bindings for native Vim commands
blankline Indentation guides
cmp Completion engine
colorizer Color highlighter
comment Automatic (un)commenting support
defaults Customizable sane defaults
diagnostics Pretty list of diagnostics, quickfixes, and more
fugitive Git wrapper
gitsigns Git code decorations
icons Adds file type icons
indentline Whitespace characters visualization
languages Enable language layers
lsp Manager for Neovim's LSP client and LSP servers
lspformat Formatting on save via LSP
lspsignature Function signatures as you type
ltex Grammar checking via LanguageTool
nvimtree File explorer tree
outline Buffer outline as a tree-like view of symbols
rainbow Rainbow parenthesis via Treesitter
snippet Code snippets engine
statusline Customizable status line
telescope Fuzzy finder and related features
theme Install and enable classic vim themes
treesitter Syntax highlighting
whichkey Popups for key bindings suggestions
zen Distraction-free "zen" mode

Language layers

Layer name Language
agda Agda
ampl AMPL
bash Bash
c C/C++
coq Coq
csharp C#
css CSS
dart Dart
go Go
haskell Haskell
hcl HCL
html HTML
idris Idris
java Java
javascript JavaScript/TypeScript
json JSON
latex $\LaTeX$
lean Lean
lua Lua
markdown Markdown
ocaml OCaml
php PHP
prolog (SWI-/GNU-/...)Prolog
python Python
rust Rust
svelte Svelte
swift Swift
toml TOML
typst Typst
vue Vue