Add CopilotChat
dblume

dblume commited on 2025-04-14 12:52:45
Showing 1 changed files, with 9 additions and 0 deletions.


Note that both Copilot and CopilotChat map the <Tab> key and only one
wins. So I map S-Tab for CopilotChat.

Also CopilotChat says to add `popup` to nvim's `completeopt`, and it
is already added, so I'm good there.
... ...
@@ -482,4 +482,13 @@ lua << EOF
482 482
       },
483 483
     },
484 484
   }
485
+
486
+  -- https://github.com/CopilotC-Nvim/CopilotChat.nvim
487
+  require("CopilotChat").setup({
488
+  })
489
+
490
+-- Both Copilot and CopilotChat are installed and both remap "<Tab>". Make <S-Tab> work for CopilotChat.
491
+-- https://github.com/CopilotC-Nvim/CopilotChat.nvim/issues/1062
492
+vim.keymap.set('i', '<S-Tab>', 'copilot#Accept("\\<S-Tab>")', { expr = true, replace_keycodes = false })
493
+
485 494
 EOF
486 495