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

Add options to limit auto completion and buffer completion #557

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

felixendres
Copy link

Add option to limit usage of buffer/buffer completion

Auto completion can now be set to be triggered on specific trigger types. This is useful to auto-complete on trigger characters only, e.g. when typing a dot to access a class member, or a colon for a namespaced symbol. See documentation of option autoCompleteTriggers in options.vim.

When completing a file name or a class method, buffer completion makes the list longer and provides little value. The option bufferCompletionTriggers allows to turn buffer completion of for specific trigger types.

The first part (auto completion) was discussed in #553. I made the PR accordingly.

Felix Endres added 2 commits September 12, 2024 11:41
I find it distracting to have auto completion for everything I type.
I'd rather have it only triggered on trigger characters, e.g. when
typing a dot to access a class member, or a colon, when using a
namespaced symbol.

This change allows to flexibly limit auto completion to any trigger
kinds.
When completing a file name or a class method, buffer completion makes
the list longer and provides little value. This option allows to turn
buffer completion off for completions triggered by trigger characters.
@Shane-XB-Qian
Copy link
Contributor

Shane-XB-Qian commented Sep 13, 2024 via email

@felixendres
Copy link
Author

I do know, that I can toggle buffer and auto completion with the options "autoComplete" and "useBufferCompletion".

But I want them only in specific cases:

  • Auto completion shall only happen after typing trigger characters and shall not include buffer completions.
  • Buffer completions shall only be included in the result when typing words and triggering omni-completion manually

I do not see how that specific behavior can be achieved with the existing options. If you think this is possible, please tell me how.

@Shane-XB-Qian
Copy link
Contributor

Shane-XB-Qian commented Sep 16, 2024 via email

@felixendres
Copy link
Author

Oh, it's not that complicated, I hope.

On the one hand, if I type myobject. or myclass:: in C++ code, I want completion to be triggered automatically and I only want the object members as completion list, not the buffer completions.

On the other hand, I don't want the completion popup on everything I write.

But when I do trigger it manually (with ) I want it to include the buffer completions, because maybe I'm just repeatedly typing some word in a comment or string.

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

Successfully merging this pull request may close these issues.

2 participants