zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.64k stars 75 forks source link

Accept When Panel Does Not Come Up #155

Closed jrock2004 closed 1 year ago

jrock2004 commented 1 year ago

So when I start typing I get these inline suggestions, but not sure how to accept them

image

Here is my config for lazyvim that I am using

return {
  "zbirenbaum/copilot.lua",
  cmd = "Copilot",
  build = ":Copilot auth",
  -- event = "InsertEnter",
  config = function()
    require("copilot").setup({
      panel = {
        enabled = true,
        auto_refresh = false,
        keymap = {
          jump_prev = "[[",
          jump_next = "]]",
          accept = "<CR>",
          refresh = "gr",
          open = "<M-CR>",
        },
        layout = {
          position = "bottom", -- | top | left | right
          ratio = 0.4,
        },
      },
      suggestion = {
        enabled = true,
        auto_trigger = true,
        debounce = 75,
        keymap = {
          accept = "<TAB>",
          accept_word = false,
          accept_line = false,
          next = "<M-]>",
          prev = "<M-[>",
          dismiss = "<C-]>",
        },
      },
      filetypes = {
        yaml = false,
        markdown = false,
        help = false,
        gitcommit = false,
        gitrebase = false,
        hgcommit = false,
        svn = false,
        cvs = false,
        ["."] = false,
      },
      copilot_node_command = "node", -- Node.js version must be > 16.x
      server_opts_overrides = {},
    })
  end,
}
MunifTanjim commented 1 year ago

Your <Tab> mapping might be overridden by some other plugin. Run :verbose imap <Tab> to see what it's mapped to. Either fix that, or use another mapping.

Also, check this comment: https://github.com/zbirenbaum/copilot.lua/discussions/99#discussioncomment-4483942

jrock2004 commented 1 year ago

Ah, you are right, need to figure out what in lazy vim is using tab

image