languages layer#
The languages layer is in charge of loading languages layers. These usually
provide language-specific features such as:
- a language server;
- Tree-sitter parsers-based functionalities;
- language-specific additional plugins.
Configuration#
A list of names of languages layers as strings. The order is not relevant.
Individual language layers need to be listed among the standard ones only when you want to pass an explicit configuration. Language layers have two common settings:
lsp: the LS to use. Defaults tonil, meaningvisimpwill install one from Mason for you if possible. If set to a string, a preinstalled executable with such name will be looked up on the system. If set to false, no LS is run;lspconfig: if an LS is being used, the default LS-specific settings for it can be overwritten here.
Several language layers diverge from this basic configuration:
agdahas its own doc page;ampldoes not have a LS on Mason, and thus can only be configured if a preinstalled executable is specified;bashadds thefishoption (defaults tofalse) which, if set to true, adds support for the Fish shell;cadds thecandcppoptions (both default totrue) which enable support for both languages;cssadds thescssoption (defaults tofalse) which, if set to true, adds Tree-sitter support for SCSS;dartadds theflutterboolean option (defaults tofalse) and theflutterconfigtable option for integration with the Flutter framework;gleamhas its own doc page;hcladds theterraformboolean option (defaults totrue) to indicate whether to use or disable the Terraform LS;idrishas its own doc page;javascriptadds thetypescriptboolean option (defaults totrue) to add Tree-sitter support for Typescript;latexadds theautocompile(defaults totrue) option for automatic compilation via LS and thetectonic(defaults tofalse) option to ask default LS Texlab to compile via Tectonic;leanhas its own doc page;rocqhas its own doc page;tomldoes not have a LS on Mason, and thus can only be configured if a preinstalled executable is specified.
Examples#
-- path/of/your/vim/config/init.lua
require("visimp")({
languages = {
'go', -- we only list Go in the languages config as we like its defaults
'latex',
},
latex = {
-- Uses an externally managed LS rather than installing one from Mason
lsp = 'texlab',
-- LS-specific config https://github.com/latex-lsp/texlab/wiki/Configuration
lspconfig = {
texlab = {
build = {
executable = 'pdflatex',
},
},
},
-- Unlike lsp and lspconfig, this setting is specific to this language layer
autocompile = false,
},
})