From c8870c67bca5ff2459cbeb20f7ed4a88f1acb7d7 Mon Sep 17 00:00:00 2001 From: Konfekt Date: Wed, 17 Feb 2016 08:16:24 +0100 Subject: [PATCH 1/2] Document omni completion setup for VimCompletesMe --- doc/vimtex.txt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/vimtex.txt b/doc/vimtex.txt index 97e126f..227db78 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -48,6 +48,7 @@ CONTENTS *vimtex-contents* Autocomplete |vimtex-complete-auto| Neocomplete |vimtex-complete-neocomplete| YouCompleteMe |vimtex-complete-youcompleteme| + VimCompletesMe |vimtex-complete-vcm| Folding |vimtex-folding| Indentation |vimtex-indent| Syntax highlighting |vimtex-syntax| @@ -1410,7 +1411,7 @@ It is described as: > Vim's omnicomplete system to provide semantic completions for many other > languages (Ruby, PHP etc.). -To enable automatic completion with |youcompleteme|, use the following options: +To enable automatic completion with |youcompleteme|, use the following options: > if !exists('g:ycm_semantic_triggers') let g:ycm_semantic_triggers = {} @@ -1420,7 +1421,25 @@ To enable automatic completion with |youcompleteme|, use the following options: \ 're!\\includegraphics([^]]*])?{[^}]*', \ 're!\\(include(only)?|input)\{[^{}]*' \ ] +< +VimCompletesMe~ + *vimtex-complete-vcm* +A plugin that overrides to trigger various built-in completions. +The plugin is available here: https://github.com/ajh17/VimCompletesMe. +The following options may be used to enable automatic completion for LaTeX +documents with |neocomplete| and |vimtex|s omni completion function: > + +augroup VimCompletesMe + autocmd! + autocmd FileType tex let b:vcm_omni_pattern = + \ '\v\\%(' + \ . '\a*%(ref|cite)\a*%(\s*\[[^]]*\])?\s*\{[^{}]*' + \ . '|includegraphics%(\s*\[[^]]*\])?\s*\{[^{}]*' + \ . '|%(include%(only)?|input)\s*\{[^{}]*' + \ . ')$' +augroup END +< ============================================================================== FOLDING *vimtex-folding* From 3a59c660cc73938150fbc2ddc6d2148b3a554f85 Mon Sep 17 00:00:00 2001 From: Konfekt Date: Wed, 17 Feb 2016 11:19:51 +0100 Subject: [PATCH 2/2] introduce and explain vimcompletesme in more detail --- doc/vimtex.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/vimtex.txt b/doc/vimtex.txt index 227db78..bf3b691 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -1375,8 +1375,10 @@ Autocomplete~ *vimtex-complete-auto* Vim does not provide automatic completion by itself, but there exist at least -two good plugins that provide this: |neocomplete| and |youcompleteme|. See below -for descriptions on how to setup these with |vimtex|. +two good plugins that provide this: |neocomplete| and |youcompleteme|. +Moreover, there is |VimCompletesMe| that overrides to trigger different +built-in completions, such as the omni-completion by vimtex, depending on the +context. See below for descriptions on how to setup these with |vimtex|. neocomplete~ *vimtex-complete-neocomplete* @@ -1424,13 +1426,14 @@ To enable automatic completion with |youcompleteme|, use the following options: < VimCompletesMe~ *vimtex-complete-vcm* -A plugin that overrides to trigger various built-in completions. -The plugin is available here: https://github.com/ajh17/VimCompletesMe. +A plugin that overrides to trigger the built-in completion that is +most suitable to the current contex. The plugin is available here: +https://github.com/ajh17/VimCompletesMe. The following options may be used to enable automatic completion for LaTeX -documents with |neocomplete| and |vimtex|s omni completion function: > +documents with |VimCompletesMe| and |vimtex|s omni completion function: > -augroup VimCompletesMe +augroup VimCompletesMeTex autocmd! autocmd FileType tex let b:vcm_omni_pattern = \ '\v\\%('