diff --git a/init.lua b/init.lua index bc34760..c766ca3 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,6 @@ +local cmp = require('cmp') +-- Never gonna give you up +-- Never gonna -- AstroNvim Configuration Table -- All configuration changes should go inside of the table below @@ -271,7 +274,7 @@ local config = { -- [""] = false, }, i = { - [""] = { "copilot#Accept('')", silent = true, expr = true }, + -- [""] = { "copilot#Accept('')", silent = true, expr = true }, } }, @@ -292,7 +295,7 @@ local config = { -- end, -- }, -- - { + { "folke/todo-comments.nvim", event = "BufRead", config = function() diff --git a/plugins/cmp.lua b/plugins/cmp.lua new file mode 100644 index 0000000..b247eed --- /dev/null +++ b/plugins/cmp.lua @@ -0,0 +1,25 @@ +local cmp = require "cmp" +local luasnip = require "luasnip" +return { + preselect = cmp.PreselectMode.None, + mapping = { + [""] = cmp.mapping.confirm { select = false }, + [""] = cmp.mapping(function(fallback) + vim.api.nvim_feedkeys(vim.fn['copilot#Accept'](vim.api.nvim_replace_termcodes('', true, true, true)), 'n', + true) + end) + -- if luasnip.expandable() then + -- luasnip.expand() + -- elseif luasnip.expand_or_jumpable() then + -- luasnip.expand_or_jump() + -- fallback() + -- end + -- end, { + -- "i", + -- "s", + -- }), + }, + experimental = { + ghost_text = false -- this feature conflict with copilot.vim's preview. + } +}