diff options
| -rw-r--r-- | lua/ache/plugins/alternate-toggler.lua | 20 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/lspconfig.lua | 64 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/ltex-extra.lua | 2 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/mason-lspconf.lua | 225 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/mason.lua (renamed from lua/ache/plugins/lsp/mason-config.lua) | 5 | ||||
| -rw-r--r-- | lua/ache/plugins/lsp/rust-tools.lua | 2 | ||||
| -rw-r--r-- | lua/ache/plugins/nvim-cmp.lua | 16 | ||||
| -rw-r--r-- | lua/ache/plugins/scamp.lua | 19 | ||||
| -rw-r--r-- | lua/ache/plugins/twilight.lua | 2 |
9 files changed, 94 insertions, 261 deletions
diff --git a/lua/ache/plugins/alternate-toggler.lua b/lua/ache/plugins/alternate-toggler.lua new file mode 100644 index 0000000..ab9dfe1 --- /dev/null +++ b/lua/ache/plugins/alternate-toggler.lua @@ -0,0 +1,20 @@ +-- A very small plugin to toggle value and expression + +return { + "rmagatti/alternate-toggler", + enabled = true, + config = function() + require("alternate-toggler").setup({ + alternates = { + ["true"] = "false", + ["oui"] = "non", + ["Oui"] = "Non", + ["OUI"] = "NON", + [">="] = "<=", + ["=="] = "!=", + }, + }) + + vim.keymap.set("n", "<leader>a", ":ToggleAlternate<CR>", { desc = "Toggle value or expression" }) + end, +} diff --git a/lua/ache/plugins/lsp/lspconfig.lua b/lua/ache/plugins/lsp/lspconfig.lua index 65cf1dd..b11409f 100644 --- a/lua/ache/plugins/lsp/lspconfig.lua +++ b/lua/ache/plugins/lsp/lspconfig.lua @@ -7,16 +7,11 @@ return { enabled = true, event = { "BufReadPre", "BufNewFile" }, dependencies = { - "hrsh7th/cmp-nvim-lsp", - "williamboman/mason-lspconfig.nvim", - { "antosha417/nvim-lsp-file-operations", config = true }, - { "folke/neodev.nvim", opts = {} }, + -- "hrsh7th/cmp-nvim-lsp", + -- { "antosha417/nvim-lsp-file-operations", config = true }, + -- { "folke/neodev.nvim", opts = {} }, }, config = function() - local lspconfig = require("lspconfig") - local mason_lspconfig = require("mason-lspconfig") - local cmp_nvim_lsp = require("cmp_nvim_lsp") - vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("UserLspConfig", {}), callback = function(ev) @@ -117,41 +112,36 @@ return { end, }) - -- 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) + -- BUG: Deprecated, + --[[ local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) end - - --[[ - mason_lspconfig.setup_handlers({ - -- default handler for installed servers - function(server_name) - lspconfig[server_name].setup({ - capabilities = capabilities, - }) - end, - ["svelte"] = function() - -- Configuration specific to svelte LSP server - - end, - ["ltex"] = function() - - end, - ["lua_ls"] = function() - - end, - ["harper_ls"] = function() - - end, - ["pyright"] = function() - - end, - }) --]] + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = " ", + [vim.diagnostic.severity.WARN] = " ", + [vim.diagnostic.severity.INFO] = " ", + [vim.diagnostic.severity.HINT] = " ", + }, + texthl = { + [vim.diagnostic.severity.ERROR] = "Error", + [vim.diagnostic.severity.WARN] = "Error", + [vim.diagnostic.severity.HINT] = "Hint", + [vim.diagnostic.severity.INFO] = "Info", + }, + numhl = { + [vim.diagnostic.severity.ERROR] = "", + [vim.diagnostic.severity.WARN] = "", + [vim.diagnostic.severity.HINT] = "", + [vim.diagnostic.severity.INFO] = "", + }, + }, + }) end, } diff --git a/lua/ache/plugins/lsp/ltex-extra.lua b/lua/ache/plugins/lsp/ltex-extra.lua index d07bf7a..1bc390e 100644 --- a/lua/ache/plugins/lsp/ltex-extra.lua +++ b/lua/ache/plugins/lsp/ltex-extra.lua @@ -11,7 +11,7 @@ local ltex_ls_opts = { return { "barreiroleo/ltex_extra.nvim", - enabled = true, + enabled = false, ft = { "markdown", "tex", "text" }, dependencies = { "neovim/nvim-lspconfig" }, -- Yes, you can use the opts field, just I'm showing the setup explicitly. diff --git a/lua/ache/plugins/lsp/mason-lspconf.lua b/lua/ache/plugins/lsp/mason-lspconf.lua index 3f8b67a..df242e6 100644 --- a/lua/ache/plugins/lsp/mason-lspconf.lua +++ b/lua/ache/plugins/lsp/mason-lspconf.lua @@ -4,234 +4,29 @@ return { -- NOTE: mason is a dependencie of mason-lspconfig. Not the other way around. - "williamboman/mason-lspconfig.nvim", + "mason-org/mason-lspconfig.nvim", enabled = true, dependencies = { - "williamboman/mason.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - "mfussenegger/nvim-dap", - "jay-babu/mason-nvim-dap.nvim", + "mason-org/mason.nvim", + -- "WhoIsSethDaniel/mason-tool-installer.nvim", + -- "mfussenegger/nvim-dap", + -- "jay-babu/mason-nvim-dap.nvim", "neovim/nvim-lspconfig", }, config = function() local mason_lspconfig = require("mason-lspconfig") - local mason_tool_installer = require("mason-tool-installer") - local mason_dap = require("mason-nvim-dap") + -- local mason_tool_installer = require("mason-tool-installer") + -- local mason_dap = require("mason-nvim-dap") local lspconfig = require("lspconfig") local capabilities = require("cmp_nvim_lsp").default_capabilities() - mason_dap.setup({ - automatic_installation = true, - ensure_installed = { - "codelldb", - }, - --[[ - handlers = { - -- cette première fonction est le "gestionnaire par défaut" - -- elle s'applique à chaque serveur linguistique sans "gestionnaire personnalisé" - function(server_name) - require("lspconfig")[server_name].setup({}) - end, - }, - --]] - }) - mason_lspconfig.setup({ - lazy = false, - automatic_installation = true, - automatic_enable = { - exclude = { "harper_ls" }, - }, ensure_installed = { - "html", - "cssls", - -- "harper_ls", - "ltex", - "svelte", "lua_ls", - "pyright", - "ruff", "rust_analyzer", - }, - handlers = { - -- default handler for installed servers - function(server_name) - lspconfig[server_name].setup({ - capabilities = capabilities, - }) - end, - ["svelte"] = function() - -- Configuration specific to svelte LSP server - lspconfig["svelte"].setup({ - capabilities = capabilities, - on_attach = function(client, _) - vim.api.nvim_create_autocmd("BufWritePost", { - pattern = { "*.js", "*.mjs", "*.svelte" }, - callback = function(ctx) - -- Here use ctx.match instead of ctx.file - client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match }) - end, - }) - end, - }) - end, - ["ltex"] = function() - lspconfig["ltex"].setup({ - filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" }, - settings = { - ltex = { - enabled = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" }, - language = { "en-GB", "fr-FR" }, - setenceCacheSize = 2000, - additionalRules = { - enablePickyRules = true, - motherTongue = "fr-FR", - }, - checkFrequency = "edit", - }, - }, - }) - end, - ["lua_ls"] = function() - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - settings = { - Lua = { - -- Make the language server recognize the "vim" global variable - diagnostics = { - globals = { "vim" }, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }) - 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, - settings = { - python = { - pythonPath = "/usr/bin/python", - }, - }, - }) - end, - }, - }) - - mason_tool_installer.setup({ - ensure_installed = { - "prettier", -- Web related formatter - "stylua", -- Lua formater - -- "isort", -- Python formater - -- "black", -- Python formater too - "ruff", -- Python linter - "eslint_d", -- JavaScript linter - "llm-ls", - "shfmt", - }, - }) - - lspconfig["svelte"].setup({ - -- capabilities = capabilities, - on_attach = function(client, _) - vim.api.nvim_create_autocmd("BufWritePost", { - pattern = { "*.js", "*.mjs", "*.svelte" }, - callback = function(ctx) - -- Here use ctx.match instead of ctx.file - client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match }) - end, - }) - end, - }) - - lspconfig["lua_ls"].setup({ - -- capabilities = capabilities, - settings = { - Lua = { - -- Make the language server recognize the "vim" global variable - diagnostics = { - globals = { "vim" }, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }) - lspconfig["harper_ls"].setup({ - filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" }, - settings = { - ["harper-ls"] = { - markdown = { - IgnoreLinkTitle = true, - }, - linters = { - SpellCheck = true, - SpelledNumbers = false, - AnA = true, - SentenceCapitalization = true, - UnclosedQuotes = false, - WrongQuotes = false, - LongSentences = true, - RepeatedWords = true, - Spaces = true, - Matcher = false, - CorrectNumberSuffix = true, - }, - isolateEnglish = true, - }, - }, - }) - lspconfig["pyright"].setup({ - -- capabilities = capabilities, - settings = { - python = { - pythonPath = "/usr/bin/python", - }, - }, - }) - - lspconfig["ltex"].setup({ - filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" }, - settings = { - ltex = { - enabled = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" }, - language = { "en-GB", "fr-FR" }, - setenceCacheSize = 2000, - additionalRules = { - enablePickyRules = true, - motherTongue = "fr-FR", - }, - checkFrequency = "edit", - }, + "gopls", + "pyright", + "clangd", }, }) end, diff --git a/lua/ache/plugins/lsp/mason-config.lua b/lua/ache/plugins/lsp/mason.lua index 6fc48a9..629f2cf 100644 --- a/lua/ache/plugins/lsp/mason-config.lua +++ b/lua/ache/plugins/lsp/mason.lua @@ -5,6 +5,11 @@ return { "williamboman/mason.nvim", enabled = true, + + dependencies = { + "mason-org/mason-registry", + "neovim/nvim-lspconfig", + }, config = function() require("mason").setup({ ui = { diff --git a/lua/ache/plugins/lsp/rust-tools.lua b/lua/ache/plugins/lsp/rust-tools.lua index 6d76dce..f0d5f93 100644 --- a/lua/ache/plugins/lsp/rust-tools.lua +++ b/lua/ache/plugins/lsp/rust-tools.lua @@ -3,7 +3,7 @@ --] return { "simrat39/rust-tools.nvim", - enabled = true, + enabled = false, config = function() local rt = require("rust-tools") diff --git a/lua/ache/plugins/nvim-cmp.lua b/lua/ache/plugins/nvim-cmp.lua index a2280d9..8523d72 100644 --- a/lua/ache/plugins/nvim-cmp.lua +++ b/lua/ache/plugins/nvim-cmp.lua @@ -8,6 +8,16 @@ return { enabled = true, event = "InsertEnter", dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-vsnip", + "hrsh7th/vim-vsnip", + "refamadriz/friendly-snippets", + "onsails/lspkind.nvim", { -- TODO: Put that one in its own config file ! "L3MON4D3/LuaSnip", @@ -56,12 +66,6 @@ return { end, { silent = true }) end, }, - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "onsails/lspkind.nvim", }, config = function() local cmp = require("cmp") diff --git a/lua/ache/plugins/scamp.lua b/lua/ache/plugins/scamp.lua new file mode 100644 index 0000000..bd9d852 --- /dev/null +++ b/lua/ache/plugins/scamp.lua @@ -0,0 +1,19 @@ +--[ +-- This Neovim plugin is a simple Neovim plugin for remotely editing files. +-- +-- It uses SCP and assumes key-based SSH authentication. It's designed for people who do not use Netw +--] + +return { + "nat-418/scamp.nvim", + enabled = true, + + config = function() + require("scamp").setup({ + -- see man(5) ssh_config for more control options + scp_options = { + "ConnectTimeout=5", + }, + }) + end, +} diff --git a/lua/ache/plugins/twilight.lua b/lua/ache/plugins/twilight.lua index 0a657e6..245c2a3 100644 --- a/lua/ache/plugins/twilight.lua +++ b/lua/ache/plugins/twilight.lua @@ -4,6 +4,6 @@ return { "folke/twilight.nvim", - enabled = true, + enabled = false, opts = {}, } |