Closed felixjung closed 2 years ago
Is there a way to disable the popup for standard identifier-based completion but not snippets?
Not currently, but there should be. Related to #708; there should be a way to choose the components that go into the identifier completion.
Cool. Thanks for developing YCM.
+1 In my case the identifier based completion interferes with the semantic completion. For example when I enter these for the first time:
printf...
The completion menu shows the signature of printf
correctly.
But then I type printf
again in somewhere else in the same file, the completion item poped up is a identifier based one, only a word is shown and no function signature.
@ccll How? semantic completion for me only shows up through a semantic completion trigger or forced with ctrl+space, it never shows up just by typing letters.
How? semantic completion for me only shows up through a semantic completion trigger or forced with ctrl+space, it never shows up just by typing letters.
I don't know, when I press 'p' in printf
, it just pops up semantic completion instead of identifier based one (of cause only for the first time according to my previous post).
I'm using spf13-vim configuration, it comes with YCM support (with ultisnips and vim-snippets) but is disabled by default. After I enable YCM manually, I got this behavior.
So it might be something wrong in spf13-vim? I'll check that later, thanks for the tip!
Any news on this?
+1 from me too. I am using this awesome plugin with gocode completion. It works really nice but I would also like to disable the identifier based completion.
+1 from me too. Use case: I am using UltiSnips with a considerable amount of snippets when writing e-mail. I'd like to have YCM suggest me snippets, but no other things.
Another LaTeX user here - this would be really useful! :+1:
:)
Was just trying to accomplish this exact thing, and stumbled upon this issue. Would love to have only snippet completions, and no identifier based completions or semantic completions when writing Latex and markdown notes.
Any news on this? Was looking for something similar and stumbled upon this report
@Valloric Is this still not possible? :( Does it require a lot of effort to implement this considering the issue was opened in 2014 and now it's almost 2019?
I doubt it. But I don’t really know what you mean by ‘solve’. You can disable auto trigger, but then you would never get ultisnips suggestions.
While I personally think this isn't a good idea, it seems to have some support. Leaving this open, but the core team are unlikely to spend any effort on it.
Fellow LaTeX sufferers! Here is what I came up with today:
let g:ycm_min_num_of_chars_for_completion = 1
let g:ycm_min_num_of_chars_for_completion_enabled = g:ycm_min_num_of_chars_for_completion
let g:ycm_min_num_of_chars_for_completion_disabled = 999
function FixLaTeXCompletion()
if &ft == 'tex' && g:ycm_min_num_of_chars_for_completion != g:ycm_min_num_of_chars_for_completion_disabled
let g:ycm_min_num_of_chars_for_completion = g:ycm_min_num_of_chars_for_completion_disabled
YcmRestartServer
endif
if &ft != 'tex' && g:ycm_min_num_of_chars_for_completion == g:ycm_min_num_of_chars_for_completion_disabled
let g:ycm_min_num_of_chars_for_completion = g:ycm_min_num_of_chars_for_completion_enabled
YcmRestartServer
endif
endfunction
augroup tex_ycm
autocmd!
" Connect VimTeX and YouCompleteMe.
" Taken from |:help vimtex-complete-youcompleteme|.
autocmd VimEnter * let g:ycm_semantic_triggers.tex=g:vimtex#re#youcompleteme
" Make YouCompleteMe *not* suggest identifiers in TeX documents.
" References:
" 1. |:help g:ycm_min_num_of_chars_for_completion|
" 2. https://github.com/ycm-core/YouCompleteMe/issues/872
autocmd BufEnter * call FixLaTeXCompletion()
augroup end
If trying the above you get a E492: Not an editor command: YcmRestartServer
message, add normal!
before the calls to YcmRestartServer
.
@rionda I moved from Vim to Emacs 7 months ago.
I can't see. us implementing this unless someone from the community contributes a PR for this.
@salutis your suggestion is a Godsend! It's been what I've been looking for for months! Every Vim-Latex user would definitely find it useful.
Thanks again!
Hi,
I work a lot with LaTeX. Obviously having YCM's identifier-based completion turned on gets quite annoying, just as it would with markdown. From the YCM help I gather that setting g:ycm_min_num_of_chars_for_completion to something high like 100 in an autocmd for tex will practically disable the identifier-based completion. However, I've noticed that in this case the YCM pop-up will no longer work for UltiSnips snippets either. Is there a way to disable the popup for standard identifier-based completion but not snippets?
Thanks