neovim: Add LanguageTool language server

nazuna
Simon Bruder 2023-04-18 15:55:03 +02:00
parent 78c2e80868
commit 73c1389435
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
3 changed files with 47 additions and 0 deletions

View File

@ -11,6 +11,11 @@
};
extraConfig = {
# Make LTeX not check anything below this.
# I often use git commit -v, which adds a full diff that should not be checked.
commit.template = toString (pkgs.writeText "git-commit-template" ''
# LTeX: enabled=false'');
core.quotepath = "off";
pull.ff = "only";
diff = {

View File

@ -48,6 +48,7 @@ in
gopls
haskell-language-server
jdt-language-server
unstable.ltex-ls
rnix-lsp
rust-analyzer
(python3.withPackages (ps: with ps; [

View File

@ -290,6 +290,47 @@ lsp.jdtls.setup {
on_attach = on_attach,
cmd = {'jdt-language-server', '-configuration', '/home/simon/.cache/jdtls/config', '-data', '/home/simon/.cache/jdtls/workspace'}, -- copied from upstream, but changed executable name
}
lsp.ltex.setup {
on_attach = on_attach,
settings = {
ltex = {
language = 'en-GB',
languageToolHttpServerUri = 'https://languagetool.sbruder.de/',
},
},
-- both taken from upstream, extended
filetypes = {
'bib',
'gitcommit',
'mail',
'markdown',
'org',
'plaintex',
'rst',
'rnoweb',
'tex',
'pandoc'
},
get_language_id = function(_, filetype)
local language_id_mapping = {
bib = 'bibtex',
gitcommit = 'git-commit',
mail = 'markdown', -- quite wrong, but allows magic commands
pandoc = 'markdown',
plaintex = 'tex',
rnoweb = 'sweave',
rst = 'restructuredtext',
tex = 'latex',
xhtml = 'xhtml',
}
local language_id = language_id_mapping[filetype]
if language_id then
return language_id
else
return filetype
end
end,
}
lsp.pylsp.setup {
on_attach = on_attach,
}