From 8037a95b0317677b84c1f58d77f43da764275d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 8 Jul 2025 13:41:04 +0200 Subject: [PATCH] nvim: remove ltex-ls configuration --- .config/nvim/after/plugin/lsp.lua | 52 ------------------------------- 1 file changed, 52 deletions(-) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 6736b371..d3720440 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -155,58 +155,6 @@ for name, config in pairs(servers) do } end -function string:startswith(start) return self:sub(1, #start) == start end --- Defining Ltex plus separately to opt out of the on_attach, which overrides the tinymist bindings and break format binding -require("lspconfig")["ltex_plus"].setup { - autostart = false, -- Start manually - capabilities = capabilities, - settings = { - ltex = { - language = "fr-FR", - disabledRules = { - ["fr-FR"] = { "FRENCH_WHITESPACE", "COMMA_PARENTHESIS_WHITESPACE", "UNPAIRED_BRACKETS" }, - }, - languageToolHttpServerUri = "http://localhost:8081", - }, - }, - on_init = function(client) - -- Load dictionary - local ltex_dict_path = vim.fs.normalize(vim.fn.stdpath("config") .. "/../ltex_dict") - local ltex_dict = {} - if vim.uv.fs_stat(ltex_dict_path) then - for line in io.lines(ltex_dict_path) do - if not string.startswith(line, "#") and line ~= "" then - table.insert(ltex_dict, line) - end - end - end - client.config.settings.ltex.dictionary = { - ["fr-FR"] = ltex_dict, - ["en-US"] = ltex_dict, - } - end, - on_attach = function(client, bufno) - -- Best effort lang detection - if vim.bo.ft == "gitcommit" then - client.config.settings.ltex.language = "en-US" - elseif vim.bo.ft == "typst" or vim.bo.ft == "markdown" or vim.bo.ft == "mail" then - local lang_map = { - en = "en-US", - fr = "fr-FR", - } - for from, to in pairs(lang_map) do - if string.startswith(tostring(vim.bo.spelllang), from) then - client.config.settings.ltex.language = to - end - end - end - - vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", { buf = bufno }) - local opts = { buffer = bufno } - map("n", "ca", vim.lsp.buf.code_action, opts) - end, -} - ------------------------ -- Standalone plugins -- ------------------------