Skip to content

Commit

Permalink
feat(completion): add github copilot cmp source
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys3 committed Jun 6, 2022
1 parent 2ae9d72 commit 693e9e1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lua/config/nvim-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,30 @@ cmp.setup {
}),
},
sources = {
{ name = "nvim_lsp" },
-- https://github.com/hrsh7th/cmp-copilot
-- https://github.com/zbirenbaum/copilot-cmp
{ name = "copilot", group_index = 1 },

{ name = "cmp_tabnine", group_index = 2 },

{ name = "nvim_lsp", group_index = 3 },

-- For vsnip user.
-- { name = "vsnip" },

-- For luasnip user.
{ name = "luasnip" },
{ name = "luasnip", group_index = 4 },

{ name = "nvim_lua", group_index = 4 },

-- For ultisnips user.
-- { name = "ultisnips" },

{ name = "crates" },

{ name = "cmp_tabnine" },

{ name = "nvim_lua" },
{ name = "crates", group_index = 4 },

-- { name = "omni" },

{ name = "buffer" },
{ name = "buffer", group_index = 9 },
},
formatting = {
format = require("lsp").cmp_format {
Expand All @@ -109,6 +113,7 @@ cmp.setup {
crates = "[Crates]",
cmp_tabnine = "[TabNine]",
latex_symbols = "[Latex]",
copilot = "[Copilot]",
},
},
},
Expand Down
14 changes: 14 additions & 0 deletions lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,20 @@ return require("packer").startup {
-- use "hrsh7th/cmp-omni"
use "hrsh7th/cmp-buffer"
use "hrsh7th/cmp-path"
use {
"zbirenbaum/copilot.lua",
event = { "VimEnter" },
requires = "github/copilot.vim",
config = function()
vim.defer_fn(function()
require("copilot").setup()
end, 100)
end,
}
use {
"zbirenbaum/copilot-cmp",
after = { "copilot.lua", "nvim-cmp" },
}
use {
"tzachar/cmp-tabnine",
run = "./install.sh",
Expand Down

0 comments on commit 693e9e1

Please sign in to comment.