Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ Terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-addi
git clone https://github.com/github/copilot.vim.git `
$HOME/AppData/Local/nvim/pack/github/start/copilot.vim

* Neovim using Lazy package manager.

Add the following block to your Lazy.nvim configuration:

```lua
{
'github/copilot.vim',
event = "InsertEnter",
config = function()
-- Disable Tab key mapping to prevent conflicts
vim.g.copilot_no_tab_map = true
vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { expr = true, silent = true })

-- Enable Copilot for specific file types
vim.g.copilot_filetypes = {
["*"] = false,
python = true,
javascript = true,
lua = true,
}
end,
}
The above sets the accept mapping to `CTRL J`, it is helpful if you have the Tab key mapped for something else. Remove it is the Tab Key is not mapped.

4. Start Vim/Neovim and invoke `:Copilot setup`.

[Node.js]: https://nodejs.org/en/download/
Expand Down