Skip to content

How to change the default key position of copilot in neovim? #11611

Answered by mawkler
askfiy asked this question in Copilot
Discussion options

You must be logged in to vote

For instance, if you want to remap them to Alt-./Alt-, instead:

Using Vimscript:

imap <M-.> <Plug>(copilot-next)
imap <M-,> <Plug>(copilot-previous)

Using Lua (requires Neovim 0.7+):

vim.keymap.set('i', '<M-.>', '<Plug>(copilot-next)')
vim.keymap.set('i', '<M-,>', '<Plug>(copilot-previous)')

Using Lua (requires Neovim 0.5+):

nvim_set_keymap('i', '<M-.>', '<Plug>(copilot-next)', { noremap = false })
nvim_set_keymap('i', '<M-,>', '<Plug>(copilot-previous)', { noremap = false })

Check out :help copilot-maps for more info.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@askfiy
Comment options

@Marko-Sanchez
Comment options

@samuelabrl
Comment options

@fautore
Comment options

Answer selected by tpope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Copilot Code accurately and faster with your AI powered pair-programmer. Product Feedback
5 participants