zbirenbaum / copilot.lua

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

If <Tab> is set as the accept keymap, it is no longer possible to use it for normal tabs even when there are no suggestions #160

Closed Vanclief closed 1 year ago

Vanclief commented 1 year ago

I like to have <Tab> as my default accept mapping. However by setting it up to do that, it prevents me from using normally the <Tab> function even if there are no suggestions.

My ideal behavior would be that when there is a suggestion using <Tab> accepts it. When there is no suggestion <Tab> just inserts tabs.

Is this possible?

My config:

require('copilot').setup({
  ...
  suggestion = {
    enabled = true,
    auto_trigger = false,
    debounce = 75,
    keymap = {
      accept = "<Tab>",
      accept_word = false,
      accept_line = false,
      next = "<M-]>",
      prev = "<M-[>",
      dismiss = "<C-]>",
    },
  },
  ...
})
MunifTanjim commented 1 year ago

Check https://github.com/zbirenbaum/copilot.lua/discussions/153#discussioncomment-5701223

Vanclief commented 1 year ago

Thank you!