Skip to content

Commit 86b7abb

Browse files
Update README.md
Add installation instructions for Lazy package manager since most people have an existing Neovim configuration and Cloning might not be very efficient for them.
1 parent 8703812 commit 86b7abb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,30 @@ Terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-addi
4848
git clone https://github.com/github/copilot.vim.git `
4949
$HOME/AppData/Local/nvim/pack/github/start/copilot.vim
5050

51+
* Neovim using Lazy package manager.
52+
53+
Add the following block to your Lazy.nvim configuration:
54+
55+
```lua
56+
{
57+
'github/copilot.vim',
58+
event = "InsertEnter",
59+
config = function()
60+
-- Disable Tab key mapping to prevent conflicts
61+
vim.g.copilot_no_tab_map = true
62+
vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { expr = true, silent = true })
63+
64+
-- Enable Copilot for specific file types
65+
vim.g.copilot_filetypes = {
66+
["*"] = false,
67+
python = true,
68+
javascript = true,
69+
lua = true,
70+
}
71+
end,
72+
}
73+
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.
74+
5175
4. Start Vim/Neovim and invoke `:Copilot setup`.
5276

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

0 commit comments

Comments
 (0)