ms-jpq / coq_nvim

Fast as FUCK nvim completion. SQLite, concurrent scheduler, hundreds of hours of optimization.
GNU General Public License v3.0
3.57k stars 99 forks source link

Copilot accept_key option? #656

Closed jmhobbs closed 2 months ago

jmhobbs commented 2 months ago

It looks like copilot got pulled from thirdparty into coq main. I read #379 but it doesn't seem related.

Is there a way to configure the same accept_key option now that it is not in 3p? I still see the ghost text, but where I used to map <c-f> with accept_key I'm not sure what to use now. I'm probably just missing something in the docs 😅

Screenshot 2024-08-26 at 3 30 08 PM

TIYA and thanks for coq!

paulo commented 2 months ago

You can configure it directly with copilot.vim. From the docs:

If you'd rather use a key that isn't <Tab>, define an <expr> map that calls
copilot#Accept().  Here's an example with CTRL-J:
>
        imap <silent><script><expr> <C-J> copilot#Accept("\<CR>")
        let g:copilot_no_tab_map = v:true
<
Lua version:
>
        vim.keymap.set('i', '<C-J>', 'copilot#Accept("\\<CR>")', {
          expr = true,
          replace_keycodes = false
        })
        vim.g.copilot_no_tab_map = true
jmhobbs commented 2 months ago

Thanks! It's not quite working for me yet, but I'll fiddle with it until it does. Didn't think about something right from copilot 👍

jmhobbs commented 2 months ago

It remaps fine to other keys (like the given<C-J> for example) just fine, so it's definitely my setup around <C-F>. Thanks again!

edit: I had mapped it to manual_mode when I was messing around initially 🤦

vegerot commented 2 months ago

What about the short_name option? How do I set that? My 3p config looks like

    { src = "copilot", short_name = "✈", accept_key = "<c-f>" },