@@ -25,7 +25,12 @@ if not ok then
2525 return
2626end
2727
28- lspkind .init ()
28+ lspkind .init {
29+ symbol_map = {
30+ Copilot = " " ,
31+ },
32+ }
33+ vim .api .nvim_set_hl (0 , " CmpItemKindCopilot" , { fg = " #6CC644" })
2934
3035local cmp = require " cmp"
3136
@@ -43,6 +48,13 @@ cmp.setup {
4348 },
4449 { " i" , " c" }
4550 ),
51+ [" <M-y>" ] = cmp .mapping (
52+ cmp .mapping .confirm {
53+ behavior = cmp .ConfirmBehavior .Replace ,
54+ select = false ,
55+ },
56+ { " i" , " c" }
57+ ),
4658
4759 [" <c-space>" ] = cmp .mapping {
4860 i = cmp .mapping .complete (),
@@ -72,7 +84,7 @@ cmp.setup {
7284 -- Testing
7385 [" <c-q>" ] = cmp .mapping .confirm {
7486 behavior = cmp .ConfirmBehavior .Replace ,
75- select = true ,
87+ select = false ,
7688 },
7789
7890 -- If you want tab completion :'(
@@ -101,17 +113,17 @@ cmp.setup {
101113 -- priority
102114 -- max_item_count
103115 -- (more?)
104- sources = {
105- { name = " gh_issues" },
106-
107- -- Youtube: Could enable this only for lua, but nvim_lua handles that already.
116+ sources = cmp .config .sources ({
108117 { name = " nvim_lua" },
109-
110118 { name = " nvim_lsp" },
111- { name = " path" },
112119 { name = " luasnip" },
120+ { name = " copilot" },
121+ }, {
122+ { name = " path" },
113123 { name = " buffer" , keyword_length = 5 },
114- },
124+ }, {
125+ { name = " gh_issues" },
126+ }),
115127
116128 sorting = {
117129 -- TODO: Would be cool to add stuff like "See variable names before method names" in rust, or something like that.
0 commit comments