From d225638e1f850cbb61f5a69b53124ec312716a2a Mon Sep 17 00:00:00 2001 From: Pablu Date: Wed, 12 Nov 2025 14:25:01 +0100 Subject: [PATCH] Remove mason, cmp luasnip and lsp related stuff, added blink and nvim/lspconfig --- init.lua | 5 +-- lazy-lock.json | 9 +---- lua/plugins/blink.lua | 8 ++++ lua/plugins/completions.lua | 48 ------------------------ lua/plugins/lsp-config.lua | 71 ------------------------------------ lua/plugins/lsp.lua | 21 +++++++++++ lua/plugins/lualine.lua | 2 +- lua/plugins/none-ls.lua | 14 ------- lua/plugins/vim-lazy-dev.lua | 11 ++++++ 9 files changed, 43 insertions(+), 146 deletions(-) create mode 100644 lua/plugins/blink.lua delete mode 100644 lua/plugins/completions.lua delete mode 100644 lua/plugins/lsp-config.lua create mode 100644 lua/plugins/lsp.lua delete mode 100644 lua/plugins/none-ls.lua create mode 100644 lua/plugins/vim-lazy-dev.lua diff --git a/init.lua b/init.lua index cb91e47..2c06301 100644 --- a/init.lua +++ b/init.lua @@ -14,6 +14,7 @@ vim.opt.rtp:prepend(lazypath) require("vim-options") require("lazy").setup("plugins") + -- Panes vim.cmd.set("splitright") vim.keymap.set("n", "/", function() @@ -63,7 +64,3 @@ vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, {}) vim.keymap.set("n", "cr", vim.lsp.buf.rename, {}) -vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) -vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) -vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, {}) -vim.keymap.set("n", "cr", vim.lsp.buf.rename, {}) diff --git a/lazy-lock.json b/lazy-lock.json index 7e03cb5..472d77e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,22 +1,15 @@ { "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, "autoclose.nvim": { "branch": "main", "commit": "3f86702b54a861a17d7994b2e32a7c648cb12fb1" }, + "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, "catppuccin": { "branch": "main", "commit": "234fc048de931a0e42ebcad675bf6559d75e23df" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, - "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, "neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" }, "neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" }, - "none-ls.nvim": { "branch": "main", "commit": "550197530c12b4838d685cf4e0d5eb4cca8d52c7" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" }, "nvim-lspconfig": { "branch": "master", "commit": "c8503e63c6afab3ed34b49865a4a4edbb1ebf4a8" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua new file mode 100644 index 0000000..2cccd87 --- /dev/null +++ b/lua/plugins/blink.lua @@ -0,0 +1,8 @@ +return { + "saghen/blink.cmp", + dependecies = { "rafamadriz/friendly-snippets" }, + version = "1.*", + opts = { + keymap = { preset = "enter" } + } +} diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua deleted file mode 100644 index 45a822a..0000000 --- a/lua/plugins/completions.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - { - "hrsh7th/cmp-nvim-lsp" - }, - { - "L3MON4D3/LuaSnip", - version = "v2.*", -- Replace by the latest released major (first number of latest release) - -- install jsregexp (optional!). - build = "make install_jsregexp", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - }, - { - "hrsh7th/nvim-cmp", - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - require("luasnip").lsp_expand(args.body) -- For `luasnip` users. - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, -- For luasnip users. - }, { - { name = "buffer" }, - }), - }) - end, - }, -} diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua deleted file mode 100644 index 7404665..0000000 --- a/lua/plugins/lsp-config.lua +++ /dev/null @@ -1,71 +0,0 @@ -return { - "neovim/nvim-lspconfig", - dependencies = { - "mason-org/mason.nvim", - "mason-org/mason-lspconfig.nvim", - { - "folke/lazydev.nvim", - ft = "lua", -- only load on lua files - opts = { - library = { - -- See the configuration section for more details - -- Load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - }, - }, - }, - }, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - local handlers = { - -- ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }), - -- ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }), - } - - require("mason").setup() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "gopls", - "html", - "basedpyright", - "clangd", - "yamlls", - "ansiblels", - }, - handlers = { - function(server_name) - require("lspconfig")[server_name].setup { - capabilities = capabilities, - handlers = handlers - } - end, - clangd = function() - local lspconfig = require("lspconfig") - lspconfig.clangd.setup({ - capabilities = capabilities, - handlers = handlers, - init_options = { - fallbackFlags = { '--std=c++20' } - }, - }) - end, - } - }) - - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("lsp", { clear = true }), - callback = function(args) - -- 2 - vim.api.nvim_create_autocmd("BufWritePre", { - -- 3 - buffer = args.buf, - callback = function() - -- 4 + 5 - vim.lsp.buf.format { async = false, id = args.data.client_id } - end, - }) - end - }) - end, -} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..167e78a --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,21 @@ +return { + "neovim/nvim-lspconfig", + config = function() + vim.lsp.enable({ "lua_ls", "basedpyright", "gopls", "html", "yamlls", "svelte-language-server", "clangd", "ansiblels" }) + + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp", { clear = true }), + callback = function(args) + -- 2 + vim.api.nvim_create_autocmd("BufWritePre", { + -- 3 + buffer = args.buf, + callback = function() + -- 4 + 5 + vim.lsp.buf.format { async = false, id = args.data.client_id } + end, + }) + end + }) + end +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 6c00bc3..669b6cd 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -8,4 +8,4 @@ return { } }) end -} +} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua deleted file mode 100644 index 10d377d..0000000 --- a/lua/plugins/none-ls.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.gofmt, - null_ls.builtins.formatting.prettierd, - null_ls.builtins.formatting.black - }, - }) - end, -} diff --git a/lua/plugins/vim-lazy-dev.lua b/lua/plugins/vim-lazy-dev.lua new file mode 100644 index 0000000..864161c --- /dev/null +++ b/lua/plugins/vim-lazy-dev.lua @@ -0,0 +1,11 @@ +return { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, +}