all repos

init.lua @ 79edb3f

my nvim config
1 files changed, 7 insertions(+), 5 deletions(-)
refactor(cmp): change the way of setupping copilot-cmp. make it easier to disable copilot
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2024-04-04 20:30:00 +0300
Parent: ee3d712
M lua/plugins/completion.lua

@@ -7,24 +7,26 @@ "hrsh7th/cmp-buffer",

"saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-path", "hrsh7th/cmp-nvim-lsp", - { "zbirenbaum/copilot-cmp", dependencies = "copilot.lua" }, + { + "zbirenbaum/copilot-cmp", + dependencies = "copilot.lua", + enabled = true, + opts = {}, + }, }, config = function() local cmp = require "cmp" local cmp_autopairs = require "nvim-autopairs.completion.cmp" - local luasnip = require "luasnip" cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) cmp.setup.filetype({ "gitcommit", "NeogitCommitMessage" }, { sources = { { name = "buffer" }, { name = "luasnip" } }, }) - require("copilot_cmp").setup() - cmp.setup { snippet = { expand = function(args) - luasnip.lsp_expand(args.body) + require("luasnip").lsp_expand(args.body) end, }, window = {},