Skip to content

Commit 38f61fb

Browse files
authored
Merge pull request #526 from Usergh0st/master
Added Copilot AI for code assistance in Neovim
2 parents 55b4dd8 + c34de18 commit 38f61fb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
return {
2+
"github/copilot.vim",
3+
config = function()
4+
-- Auto active copilot
5+
vim.cmd("Copilot enable")
6+
7+
-- Recomends options
8+
vim.g.copilot_no_tab_map = true
9+
vim.api.nvim_set_keymap("i", "<C-s>", 'copilot#Accept("<CR>")', { silent = true, expr = true }) -- Use <Ctrl + s> to accept suggestion
10+
vim.api.nvim_set_keymap("i", "<C-n>", 'copilot#Dismiss()', { silent = true, expr = true }) -- Use <Ctrl + n> to dismiss suggestion
11+
vim.api.nvim_set_keymap("i", "<M-]>", "<Plug>(copilot-next)", {}) -- Use <Alt + [> to go to next suggestion
12+
vim.api.nvim_set_keymap("i", "<M-[>", "<Plug>(copilot-previous)", {}) -- Use <Alt + ]> to go to previous suggestion
13+
vim.api.nvim_set_keymap("i", "<C-Space>", "<Plug>(copilot-suggest)", {}) -- Use <Ctrl + Space> to trigger suggestion
14+
vim.api.nvim_set_keymap("n", "<leader>cp", ":Copilot panel<CR>", { noremap = true, silent = true }) -- Use <leader + cp> to open copilot panel
15+
end,
16+
}

0 commit comments

Comments
 (0)