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

Question / recipe: How to use cmp-buffer as a replacement for Vim's builtin <C-n>/<C-p> keyword completion? #78

Open
jfly opened this issue Sep 23, 2024 · 0 comments

Comments

@jfly
Copy link

jfly commented Sep 23, 2024

I'd like to use cmp-buffer as a completion source for nvim-cmp, but only when I explicitly request completion via <C-n>/<C-p>.

I've hacked this together locally:

  1. I created a new nvim-cmp source that wraps cmp-buffer. The only difference is that my complete method doesn't do anything if params.context:get_reason() == types.cmp.ContextReason.Manual.
  2. I added <C-n>/<C-p> mappings to invoke require("cmp").complete.
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

1 participant