diff --git a/lua/cargdev/plugins/copilot.lua b/lua/cargdev/plugins/copilot.lua index 1c174d8..2a4783c 100644 --- a/lua/cargdev/plugins/copilot.lua +++ b/lua/cargdev/plugins/copilot.lua @@ -14,9 +14,16 @@ return { }, }, suggestion = { - enabled = true, - auto_trigger = true, -- Enable auto-trigger suggestions as you type + enabled = true, -- Codetyper will use copilot when available + auto_trigger = true, debounce = 75, + keymap = { + -- Let codetyper handle keymaps for unified experience + accept = false, + next = false, + prev = false, + dismiss = false, + }, }, filetypes = { markdown = true, diff --git a/lua/cargdev/plugins/nvim-cmp.lua b/lua/cargdev/plugins/nvim-cmp.lua index dcaf447..8d5430e 100644 --- a/lua/cargdev/plugins/nvim-cmp.lua +++ b/lua/cargdev/plugins/nvim-cmp.lua @@ -47,20 +47,20 @@ return { [""] = cmp.mapping.complete(), -- show completion suggestions [""] = cmp.mapping.abort(), -- close completion window [""] = cmp.mapping.confirm({ select = false }), - -- Tab is reserved for Copilot inline suggestions ONLY - -- Use / to navigate cmp menu, to confirm + -- Tab: codetyper suggestion > cmp selection > snippet jump > fallback [""] = cmp.mapping(function(fallback) - -- Check for Copilot inline suggestion first (highest priority) - local copilot_ok, copilot_suggestion = pcall(require, "copilot.suggestion") - if copilot_ok and copilot_suggestion.is_visible() then - copilot_suggestion.accept() + -- Check for codetyper ghost text suggestion first + local ok, suggestion = pcall(require, "codetyper.suggestion") + if ok and suggestion.is_visible() then + suggestion.accept() return end - -- If no Copilot suggestion, handle snippet jumping - if luasnip.expand_or_jumpable() then + -- Then cmp menu + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() else - -- Default Tab behavior (insert tab character) fallback() end end, { "i", "s" }), @@ -74,9 +74,9 @@ return { end, { "i", "s" }), }), -- sources for autocompletion + -- Note: codetyper uses ghost text suggestions (Copilot-style), not cmp source sources = cmp.config.sources({ - { name = "nvim_lsp", priority = 1000}, - { name = "copilot", priority = 900 }, -- GitHub Copilot suggestions + { name = "nvim_lsp", priority = 1000 }, { name = "luasnip", priority = 750 }, -- snippets { name = "buffer", priority = 500, keyword_length = 3 }, -- text within current buffer { name = "path", priority = 250 }, -- file system paths