It doesn't matter if you are writing C++ codes, everything is under std:: or some well known namespaces.
But if you are writing C, top level semantic completion is very needed.
When I am coding in vscode or some other IDEs, top level semantic completion will always popup without pressing any key. YCM is trying to bring IDE features to Vim, but no IDE need a <c-space>.
Getting tired to type <c-space> again and again, can I have an option to enable semantic completion triggers automatically ?? If so, coding will be much more fluent in YCM.
no IDE need a
.
That's wrong. Have a look at java IDEs.
can I have an option to enable semantic completion triggers automatically ??
Having been using YCM for two years, I certainly know the g:ycm_semantic_triggers option.
But I still have to enter a "::" or a "." to trigger semantic completion, if you are writing C++, you always type a "std::" or "boost::", but top level semantic completion must be triggerred by "::" or ".".
What I need is when I type "Mess" semantic completion will popup the candidates starting with "Mess" like: MessageBox, MessageBeep, MessageBoxEx, ...
Can I setup a rule in g:ycm_semantic_trigger that let semantic completion popup when I type first three characters of a symbol ?
You don't have to enter :: or . to trigger semantic completion.
Write a regex that suits your needs and have semantic completion be triggered as often as you want.
To give an example, you could set the g:ycm_semantic_triggers option to
let g:ycm_semantic_triggers = {
\ 'c': [ 're!\w{1}' ]
\}
then it will automatically trigger semantic completion after typing one character in C files.
@micbou that makes sense, thanks.
Most helpful comment
To give an example, you could set the
g:ycm_semantic_triggersoption tothen it will automatically trigger semantic completion after typing one character in C files.