I am using Vim 8.0 with Python3 and myint/ClangComplete for C/C++ completions. SDL_<tab>
suggests every function and type from SDL. Is there any way to limit suggestions to SDL_EventType types, functions returning SDL_Windows, etc.? BidiComplete seems like a good place to start, since SDL_<tab>EVENT
would match SDL_WINDOWEVENT
and SDL_FIRSTEVENT
, but not SDL_FINGERDOWN
, etc. Ideally I would like to be able to filter by any/all of the fields in the ClangComplete popup menu, since I might be interested in 'functions that take an SDL_Window* as an argument or return one'. The filtering/searching mechanism can just be regex over whole text of each line in the PUM.
Asked
Active
Viewed 488 times
11
-
3Seems like you're asking for fuzzy completion, which is a feature already requested (see: https://github.com/Rip-Rip/clang_complete/issues/388). You may be able to use toobig's modification to get what you want. – gregory Feb 10 '17 at 21:15
-
Just don't use completion engine. When we use it, our brain just don't store informations about libraries we often use, and the worst is that we don't discover the logic of the library designer. I stopped to use it 6 month ago, it has dramaticly increased my productivity!! – Oliv Feb 20 '17 at 18:21
-
Wow. No. I know SDL_FINGERDOWN is an SDL_EventType because I saw it in the completions once. **My brain works just fine, thank you.** I wouldn't have known SDL_DOLLARRECORD is one without typing `SDL_EventType::` and scrolling through the results, and I don't have a better way of looking up all functions that take SDL_EventTypes than manually grepping the entire code base from the shell, poking the shared libraries, or pulling up the documentation. – John P Feb 22 '17 at 00:02
-
Use your plugin's issue tracker. – romainl Jan 08 '21 at 16:29
2 Answers
1
The Vim completion engine YCM already implements support for this feature, and integrates well with clang. http://ycm-core.github.io/YouCompleteMe/#c-family-semantic-completion

chtenb
- 14,924
- 14
- 78
- 116
0
As I mentioned in my comment, it appears as though you're asking for fuzzy completion, which is a feature that has already requested (see: github.com/Rip-Rip/clang_complete/issues/388). You may be able to use toobig's modification to get what you want.

gregory
- 10,969
- 2
- 30
- 42
-
Sorry, I don't think it does, unless the symbol to look up is alphabetically similar. 'SDL_FINGERDOWN' only shares 'SDL_' with 'SDL_DOLLARRECORD', which it shares with every other SDL entity. Am I missing something? – John P Feb 23 '17 at 17:49