nvim-config

Log | Files | Refs | Submodules | README

commit f00c71ac422eacba14d03fd6af5728a973aa9da3
parent d29b22ab34070c254e75ae4755c57b12ca87c9fd
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Tue, 14 Jun 2022 15:53:13 +0200

chore: update lsp config

Diffstat:
Minit.lua | 8++++----
Mlua/lsp_config.lua | 40++++++++++++++++++++++++++++++++++------
2 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/init.lua b/init.lua @@ -1,10 +1,10 @@ local M = {} -local ok, imp = pcall(require, 'impatient') +-- local ok, imp = pcall(require, 'impatient') -if ok then - imp.enable_profile() -end +-- if ok then +-- imp.enable_profile() +-- end require "plugins" -- Load all plugins diff --git a/lua/lsp_config.lua b/lua/lsp_config.lua @@ -14,13 +14,19 @@ vim.diagnostic.config { vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'rounded' }) vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'rounded' }) +local ignore_messages = { + ltex = true +} + local function progress_handle(infos) local new_messages = vim.lsp.util.get_progress_messages() for _, msg in ipairs(new_messages) do - if msg.message and not msg.done then - vim.notify(string.format("[%s] %s ... %s", msg.name, msg.title, msg.message)) - elseif msg.done then - vim.notify(string.format("[%s] %s ... DONE", msg.name, msg.title)) + if not ignore_messages[msg.name] then + if msg.message and not msg.done then + vim.notify(string.format("[%s] %s ... %s", msg.name, msg.title, msg.message)) + elseif msg.done then + vim.notify(string.format("[%s] %s ... DONE", msg.name, msg.title)) + end end end return false @@ -233,13 +239,12 @@ end require 'ltex-ls'.setup { on_attach = on_attach, capabilities = capabilities, - filetypes = { "latex", "tex", "bib", "markdown", "gitcommit" }, + filetypes = { "latex", "tex", "bib", "markdown", "gitcommit", "text" }, settings = { ltex = { enabled = { "latex", "tex", "bib", "markdown", }, language = "auto", diagnosticSeverity = "information", - checkFrequency = "save", sentenceCacheSize = 2000, additionalRules = { enablePickyRules = true, @@ -248,6 +253,29 @@ require 'ltex-ls'.setup { disabledRules = { fr = { "APOS_TYP", "FRENCH_WHITESPACE" } }, + latex = { + commands = { + ["\\MaxMC"] = "dummy" + } + }, + dictionary = (function() + local files = {} + for _, file in ipairs(vim.api.nvim_get_runtime_file("dict/*", true)) do + local lang = vim.fn.fnamemodify(file, ":t:r") + local fullpath = vim.fn.fnamemodify(file, ":p") + files[lang] = { ":" .. fullpath } + end + + if files.default then + for lang, _ in pairs(files) do + if lang ~= "default" then + vim.list_extend(files[lang], files.default) + end + end + files.default = nil + end + return files + end)(), trace = { server = "verbose" }, }, },