diff options
| author | anand <anand.panchdhari@gmail.com> | 2025-12-17 15:57:55 +0530 |
|---|---|---|
| committer | anand <anand.panchdhari@gmail.com> | 2025-12-17 15:57:55 +0530 |
| commit | b7ef29a8886a57aadb787807a7c6cf74c1f0ed3a (patch) | |
| tree | 366a68240fbc9da6b1d567bd6c46d1350ad814de /nvim/lsp/ltex_plus.lua | |
Nixos
Diffstat (limited to 'nvim/lsp/ltex_plus.lua')
| -rwxr-xr-x | nvim/lsp/ltex_plus.lua | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/nvim/lsp/ltex_plus.lua b/nvim/lsp/ltex_plus.lua new file mode 100755 index 0000000..e5444f9 --- /dev/null +++ b/nvim/lsp/ltex_plus.lua @@ -0,0 +1,88 @@ +---@brief +--- +--- https://github.com/ltex-plus/ltex-ls-plus +--- +--- LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others +--- +--- To install, download the latest [release](https://github.com/ltex-plus/ltex-ls-plus) and ensure `ltex-ls-plus` is on your path. +--- +--- This server accepts configuration via the `settings` key. +--- +--- ```lua +--- settings = { +--- ltex = { +--- language = "en-GB", +--- }, +--- }, +--- ``` +--- +--- To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): +--- +--- ```lua +--- vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +--- ``` + +local language_id_mapping = { + bib = 'bibtex', + pandoc = 'markdown', + plaintex = 'tex', + rnoweb = 'rsweave', + rst = 'restructuredtext', + tex = 'latex', + text = 'plaintext', +} + +local function get_language_id(_, filetype) + return language_id_mapping[filetype] or filetype +end + +return { + cmd = { 'ltex-ls-plus' }, + filetypes = { + 'bib', + 'context', + 'gitcommit', + 'html', + 'markdown', + 'org', + 'pandoc', + 'plaintex', + 'quarto', + 'mail', + 'mdx', + 'rmd', + 'rnoweb', + 'rst', + 'tex', + 'text', + 'typst', + 'xhtml', + }, + root_markers = { '.git' }, + get_language_id = get_language_id, + settings = { + ltex = { + enabled = { + 'bib', + 'context', + 'gitcommit', + 'html', + 'markdown', + 'org', + 'pandoc', + 'plaintex', + 'quarto', + 'mail', + 'mdx', + 'rmd', + 'rnoweb', + 'rst', + 'tex', + 'latex', + 'text', + 'typst', + 'xhtml', + }, + }, + }, +} |
