Add docs for integarting copilot.vim
This commit is contained in:
25
doc/cmp.txt
25
doc/cmp.txt
@@ -645,6 +645,31 @@ You can setup buffer specific configuration like this.
|
|||||||
})
|
})
|
||||||
<
|
<
|
||||||
|
|
||||||
|
How to integrate with copilot.vim?~
|
||||||
|
|
||||||
|
The copilot.vim and nvim-cmp both have a `key-mapping fallback` mechanism.
|
||||||
|
Therefore, You should manage those plugins by yourself.
|
||||||
|
|
||||||
|
Fortunately, the copilot.vim has the feature that disables the fallback mechanism.
|
||||||
|
>
|
||||||
|
let g:copilot_no_tab_map = v:true
|
||||||
|
imap <expr> <Plug>(vimrc:copilot-dummy-map) copilot#Accept("\<Tab>")
|
||||||
|
<
|
||||||
|
You can manage copilot.vim's accept feature with nvim-cmp' key-mapping configuration.
|
||||||
|
>
|
||||||
|
cmp.setup {
|
||||||
|
mapping = {
|
||||||
|
['<C-g>'] = cmp.mapping(function(fallback)
|
||||||
|
vim.api.nvim_feedkeys(vim.fn['copilot#Accept'](vim.api.nvim_replace_termcodes('<Tab>', true, true, true)), 'n', true)
|
||||||
|
end)
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
ghost_text = false -- this feature conflict to the copilot.vim's preview.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<
|
||||||
|
|
||||||
|
|
||||||
How to customize menu appearance?~
|
How to customize menu appearance?~
|
||||||
|
|
||||||
You can see the nvim-cmp wiki (https://github.com/hrsh7th/nvim-cmp/wiki).
|
You can see the nvim-cmp wiki (https://github.com/hrsh7th/nvim-cmp/wiki).
|
||||||
|
|||||||
Reference in New Issue
Block a user