From 8d32b4cfffdac5840c2d70cc1bfd086b69fe5121 Mon Sep 17 00:00:00 2001 From: 409 Date: Mon, 7 Oct 2024 23:52:35 +0200 Subject: [PATCH] feat(completion): use magazine.nvim instead of regular cmp; autopairs --- lua/409/plugins/completion.lua | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lua/409/plugins/completion.lua b/lua/409/plugins/completion.lua index 0e33526..611dff0 100644 --- a/lua/409/plugins/completion.lua +++ b/lua/409/plugins/completion.lua @@ -1,9 +1,22 @@ return { { - "hrsh7th/nvim-cmp", + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, + }, + { + "iguanacucumber/magazine.nvim", + name = "nvim-cmp", dependencies = { "onsails/lspkind.nvim", "VonHeikemen/lsp-zero.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lsp-signature-help", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "L3MON4D3/LuaSnip", }, opts = function() local cmp = require("cmp") @@ -14,6 +27,8 @@ return { vim.api.nvim_set_hl(0, "CmpPmenuBorder", { link = "FloatBorder" }) + cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done()) + return { snippet = { expand = function(args) @@ -99,11 +114,4 @@ return { } end, }, - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lsp-signature-help", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", }