28 lines
690 B
Nix
28 lines
690 B
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
lib.optionalAttrs (lib.elem "nvim::lsp::ltex" config.machine.services) {
|
|
ltex = {
|
|
cmd = [ "${pkgs.ltex-ls-plus}/bin/ltex-ls-plus" ];
|
|
settings = {
|
|
ltex = {
|
|
language = "de-DE";
|
|
languageToolHttpServerUri = lib.optionalString config.services.languagetool.enable "http://localhost:${builtins.toString config.services.languagetool.port}";
|
|
};
|
|
};
|
|
on_attach =
|
|
_: # lua
|
|
''
|
|
function(client, bufnr)
|
|
vim.api.nvim_create_user_command(
|
|
"LtexLang",
|
|
"lua SetLtexLang(<q-args>)",
|
|
{ nargs = 1, desc = "Set ltex-ls language" }
|
|
)
|
|
end'';
|
|
};
|
|
}
|