chore(nvim): use better copilot

main
sudo pacman -Syu 2023-07-06 15:29:18 +07:00
parent d803657385
commit c6bf75a80c
1 changed files with 14 additions and 9 deletions

View File

@ -13,6 +13,7 @@ vim.opt.smartcase = true
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.scrolloff = 4 vim.opt.scrolloff = 4
vim.opt.signcolumn = "number"
-- Tab -- Tab
vim.opt.tabstop = 4 vim.opt.tabstop = 4
@ -170,6 +171,7 @@ require("lazy").setup({
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-vsnip", "hrsh7th/cmp-vsnip",
"hrsh7th/vim-vsnip", "hrsh7th/vim-vsnip",
"zbirenbaum/copilot-cmp",
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
@ -188,19 +190,22 @@ require("lazy").setup({
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "copilot" },
}, { }, {
{ name = "buffer" }, { name = "buffer" },
}), }),
}) })
end,
},
-- Support copilot -- https://github.com/zbirenbaum/copilot-cmp
cmp.event:on("menu_opened", function() {
vim.b.copilot_suggestion_hidden = true "zbirenbaum/copilot-cmp",
end) dependencies = {
"zbirenbaum/copilot.lua",
cmp.event:on("menu_closed", function() },
vim.b.copilot_suggestion_hidden = false config = function()
end) require("copilot_cmp").setup()
end, end,
}, },
@ -395,7 +400,7 @@ require("lazy").setup({
enabled = false, enabled = false,
}, },
suggestion = { suggestion = {
auto_trigger = true, enabled = false,
}, },
filetypes = { filetypes = {
["."] = false, ["."] = false,