- Neovim 0.5 or later
- Documentation is generated by
scripts/docgen.lua
.- Only works on unix, you can ignore it on Windows.
- Lint task requires luacheck and stylua.
PRs are checked with Luacheck and stylua. To run the linter locally:
make lint
stylua .
Note: Github Actions automatically generates the docs, so only modify
README_template.md
or thedocs
object on the server config. Don't modifyREADME.md
directly.
To preview the generated README.md
locally, run scripts/docgen.lua
from
nvim
(from the project root):
nvim -R -Es +'set rtp+=$PWD' +'luafile scripts/docgen.lua'
The configs
module is a singleton where configs are defined. In vim.validate
parlance here is the "spec":
configs.SERVER_NAME = {
default_config = {'t'};
on_new_config = {'f', true};
on_attach = {'f', true};
commands = {'t', true};
docs = {'t', true};
}
docs = {
description = {'s', true};
default_config = {'t', true};
}
- Keys in
docs.default_config
match those ofconfigs.SERVER_NAME.default_config
, and can be used to specify custom documentation. This is useful for functions, whose docs cannot be easily auto-generated. commands
is a map ofname:definition
key:value pairs, wheredefinition
is a list whose first value is a function implementing the command and the rest are either array values which will be formed into flags for the command or special keys likedescription
. Example:commands = { TexlabBuild = { function() buf_build(0) end; "-range"; description = "Build the current buffer"; }; };
The configs.__newindex
metamethod consumes the config definition and returns
an object with a setup()
method, to be invoked by users:
require'lspconfig'.SERVER_NAME.setup{}
After you set configs.SERVER_NAME
you can add arbitrary language-specific
functions to it if necessary.
Example:
configs.texlab.buf_build = buf_build