Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copilot accept_key option? #656

Closed
jmhobbs opened this issue Aug 26, 2024 · 4 comments
Closed

Copilot accept_key option? #656

jmhobbs opened this issue Aug 26, 2024 · 4 comments

Comments

@jmhobbs
Copy link

jmhobbs commented Aug 26, 2024

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
Copy link

paulo commented Aug 27, 2024

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
Copy link
Author

jmhobbs commented Aug 27, 2024

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 jmhobbs closed this as completed Aug 27, 2024
@jmhobbs
Copy link
Author

jmhobbs commented Aug 27, 2024

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
Copy link
Contributor

vegerot commented Aug 29, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@jmhobbs @paulo @vegerot and others