diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/ache/plugins/lsp/lspconfig.lua | 45 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/ltex-extra.lua | 13 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/mason-config.lua | 18 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/mason-lspconf.lua | 2 |
4 files changed, 60 insertions, 18 deletions
diff --git a/lua/ache/plugins/lsp/lspconfig.lua b/lua/ache/plugins/lsp/lspconfig.lua index 35098f1..d859004 100644 --- a/lua/ache/plugins/lsp/lspconfig.lua +++ b/lua/ache/plugins/lsp/lspconfig.lua @@ -1,5 +1,5 @@ --[ --- Ensure that the LSP feature is up and runing. +-- Ensure that the LSP feature is up and running. --] return { @@ -22,7 +22,7 @@ return { -- Buffer local mappings. -- See `:help vim.lsp.*` for documentation on any of the functions below. - -- Keybinds + -- Keybindings vim.keymap.set( "n", "gR", @@ -101,10 +101,22 @@ return { "<cmd>LspRestart<CR>", { buffer = ev.buf, silent = true, desc = "Restart LSP" } ) + vim.keymap.set( + "n", + "<leader>ss", + "<cmd>LspStop harper_ls<CR>", + { buffer = ev.buf, silent = true, desc = "Stop harper-ls, The spell checking plugin" } + ) + vim.keymap.set( + "n", + "<leader>sS", + "<cmd>LspRestart harper_ls<CR>", + { buffer = ev.buf, silent = true, desc = "(Re)-start harper-ls, The spell checking plugin" } + ) end, }) - -- used to enable autocompletion (assign to every lsp server config) + -- Used to enable auto-completion (assign to every lsp server config) local capabilities = cmp_nvim_lsp.default_capabilities() -- Change the diagnostics symbols in the sign column (gutter) @@ -158,7 +170,7 @@ return { capabilities = capabilities, settings = { Lua = { - -- make the language server recognize the "vim" global variable + -- Make the language server recognize the "vim" global variable diagnostics = { globals = { "vim" }, }, @@ -169,6 +181,31 @@ return { }, }) end, + ["harper_ls"] = function() + lspconfig["harper_ls"].setup({ + settings = { + ["harper-ls"] = { + markdown = { + IgnoreLinkTitle = true, + }, + linters = { + SpellCheck = true, + SpelledNumbers = true, + AnA = true, + SentenceCapitalization = true, + UnclosedQuotes = true, + WrongQuotes = false, + LongSentences = true, + RepeatedWords = true, + Spaces = true, + Matcher = true, + CorrectNumberSuffix = true, + }, + isolateEnglish = true, + }, + }, + }) + end, ["pyright"] = function() lspconfig["pyright"].setup({ capabilities = capabilities, diff --git a/lua/ache/plugins/lsp/ltex-extra.lua b/lua/ache/plugins/lsp/ltex-extra.lua index 9ae2d3a..d877dc4 100644 --- a/lua/ache/plugins/lsp/ltex-extra.lua +++ b/lua/ache/plugins/lsp/ltex-extra.lua @@ -1,4 +1,6 @@ -- LanguageTool LSP. +-- +-- A plugin to check "french" spelling in Markdown, TeX, and text files. local ltex_extra_opts = {} local ltex_ls_opts = { @@ -11,19 +13,24 @@ return { "barreiroleo/ltex_extra.nvim", ft = { "markdown", "tex", "text" }, dependencies = { "neovim/nvim-lspconfig" }, - -- yes, you can use the opts field, just I'm showing the setup explicitly + -- Yes, you can use the opts field, just I'm showing the setup explicitly. config = function() + local cmp_nvim_lsp = require("cmp_nvim_lsp") + local capabilities = cmp_nvim_lsp.default_capabilities() + require("ltex_extra").setup({ ltex_extra_opts, server_opts = { - -- capabilities = capabilities, - -- + capabilities = capabilities, + filetypes = { "markdown", "text" }, flags = { debounce_text_changes = 300 }, cmd = { "ltex-ls" }, + -- on_attach = function(client, bufnr) -- -- your on_attach process -- end, + -- settings = ltex_ls_opts, }, }) diff --git a/lua/ache/plugins/lsp/mason-config.lua b/lua/ache/plugins/lsp/mason-config.lua index 11f086c..e19ada0 100644 --- a/lua/ache/plugins/lsp/mason-config.lua +++ b/lua/ache/plugins/lsp/mason-config.lua @@ -1,6 +1,5 @@ --[ --- This plugin is responsable of having external tools correcly present on the system. --- Precisely, the configuration part. +-- This plugin is responsible of having external tools correctly configured. --] return { @@ -17,10 +16,10 @@ return { local mason_lspconfig = require("mason-lspconfig") local mason_tool_installer = require("mason-tool-installer") local mason_dap = require("mason-nvim-dap") - local lspconfig = require("lspconfig") mason.setup() mason_dap.setup({ + automatic_installation = true, ensure_installed = { "codelldb", }, @@ -28,10 +27,11 @@ return { mason_lspconfig.setup({ lazy = true, + automatic_installation = true, ensure_installed = { - -- "tsserver", "html", "cssls", + "harper_ls", "ltex", "svelte", "lua_ls", @@ -44,15 +44,13 @@ return { mason_tool_installer.setup({ ensure_installed = { "prettier", -- Web related formatter - "stylua", -- Lua formatter - "isort", -- Python formatter - "black", -- Python formatter too + "stylua", -- Lua formater + "isort", -- Python formater + "black", -- Python formater too -- "ruff", -- Python linter - "eslint_d", -- JS linter + "eslint_d", -- JavaScript linter "llm-ls", }, }) - - -- lspconfig.pyright.setup({}) end, } diff --git a/lua/ache/plugins/lsp/mason-lspconf.lua b/lua/ache/plugins/lsp/mason-lspconf.lua index 06b5edf..03d564b 100644 --- a/lua/ache/plugins/lsp/mason-lspconf.lua +++ b/lua/ache/plugins/lsp/mason-lspconf.lua @@ -1,5 +1,5 @@ --[ --- This plugin is responsable of having external tools correcly present on the system. +-- This plugin is responsible of having external tools correctly installed. --] return { |