From 25fa81894701c48d089016760aadd6b92761dece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sat, 4 Apr 2015 15:26:15 +0200 Subject: [PATCH] expand documentation with YCM autocompletion configuration --- doc/vimtex.txt | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/vimtex.txt b/doc/vimtex.txt index 546562f..1e5c589 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -860,9 +860,25 @@ automatic completion with |vimtex|: > let g:neocomplete#sources#omni#input_patterns.tex = \ '\v\\\a*(ref|cite)\a*([^]]*\])?\{([^}]*,)*[^}]*' -I do not know the appropriate settings to enable good autocomplete with -YouCompleteMe. If anyone has a good set of settings that provide autocomplete -with YouCompleteMe for |vimtex|, I will be happy to accept pull requests. +To enable automatic completion with YouCompleteMe, it has to be explicitely +enabled for the tex filetype. For tex files, it is also a good idea to disable +the identifier based completion and rely only on semantic completion, which +will use the 'omnifunc' set by |vimtex|. Then the same patterns as above can +be used to trigger the semantic completion. + + " enable YCM for tex files + let g:ycm_filetype_whitelist.tex = 1 + + " disable identifier based completion for tex files + autocmd FileType tex let g:ycm_min_num_of_chars_for_completion = 99 + + " set patterns to trigger semantic completion + if !exists('g:ycm_semantic_triggers') + let g:ycm_semantic_triggers = {} + endif + let g:ycm_semantic_triggers.tex = [ + \ '\v\\\a*(ref|cite)\a*([^]]*\])?\{([^}]*,)*[^}]*' + \ ] ============================================================================== FOLDING *vimtex-folding*