Improved consistency of completion docs

This commit is contained in:
Karl Yngve Lervåg 2016-04-08 22:25:30 +02:00
parent 2012e74532
commit 56ded832f8

View File

@ -42,8 +42,8 @@ CONTENTS *vimtex-contents*
Insert mode mappings |vimtex-imaps| Insert mode mappings |vimtex-imaps|
Events |vimtex-events| Events |vimtex-events|
Completion |vimtex-completion| Completion |vimtex-completion|
Complete labels |vimtex-complete-labels|
Complete citations |vimtex-complete-cites| Complete citations |vimtex-complete-cites|
Complete labels |vimtex-complete-labels|
Complete image file names |vimtex-complete-images| Complete image file names |vimtex-complete-images|
Complete input file names |vimtex-complete-input| Complete input file names |vimtex-complete-input|
Complete PDF file names |vimtex-complete-pdf| Complete PDF file names |vimtex-complete-pdf|
@ -1370,38 +1370,15 @@ If |g:vimtex_complete_enabled| is 1 (default), then |vimtex| sets the
'omnifunc' to provide omni completion, see |compl-omni|. Omni completion is 'omnifunc' to provide omni completion, see |compl-omni|. Omni completion is
then accessible with |i_CTRL-X_CTRL-O|. then accessible with |i_CTRL-X_CTRL-O|.
The omni completion completes labels, citations, and file names for figures. The omni completion completes citations, labels, glossary entries and
If desired, one may set |g:vimtex_complete_close_braces|, which makes the filenames. If desired, one may set |g:vimtex_complete_close_braces|, which
completion include closing braces. makes the completion include closing braces.
Associated settings: Associated settings:
|g:vimtex_complete_enabled| |g:vimtex_complete_enabled|
|g:vimtex_complete_close_braces| |g:vimtex_complete_close_braces|
|g:vimtex_complete_recursive_bib| |g:vimtex_complete_recursive_bib|
------------------------------------------------------------------------------
Complete labels~
*vimtex-complete-labels*
Label completion is triggered by '\ref{' commands. The completion parses every
relevant aux file to gather the completion candidates. This is important,
because it means that the completion only works when the LaTeX document has
been compiled.
As an example: >
\ref{sec:<CTRL-X><CTRL-O>
offers a list of all matching labels, with their associated value and page
number. The label completion matches:
1. labels: >
\ref{sec:<CTRL-X><CTRL-O>
< 2. numbers: >
\eqref{2<CTRL-X><CTRL-O>
< 3. labels and numbers together (separated by whitespace): >
\eqref{eq 2<CTRL-X><CTRL-O>
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Complete citations~ Complete citations~
*vimtex-complete-cites* *vimtex-complete-cites*
@ -1428,6 +1405,29 @@ Then the bibliography key `knuth1981` will be completed with e.g.: >
In particular, note that regular expressions (or vim patterns) can be used In particular, note that regular expressions (or vim patterns) can be used
after '\cite{' to search for candidates. after '\cite{' to search for candidates.
------------------------------------------------------------------------------
Complete labels~
*vimtex-complete-labels*
Label completion is triggered by '\ref{' commands. The completion parses every
relevant aux file to gather the completion candidates. This is important,
because it means that the completion only works when the LaTeX document has
been compiled.
As an example: >
\ref{sec:<CTRL-X><CTRL-O>
offers a list of all matching labels, with their associated value and page
number. The label completion matches:
1. labels: >
\ref{sec:<CTRL-X><CTRL-O>
< 2. numbers: >
\eqref{2<CTRL-X><CTRL-O>
< 3. labels and numbers together (separated by whitespace): >
\eqref{eq 2<CTRL-X><CTRL-O>
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Complete file names for figures~ Complete file names for figures~
*vimtex-complete-images* *vimtex-complete-images*
@ -1441,35 +1441,35 @@ complete only the tail part of file names. This is useful if one uses the
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Complete input/include tex files~ Complete input/include tex files~
*vimtex-complete-input* *vimtex-complete-input*
File name completion for input/include files is triggered by '\input{' or File name completion for input/include files is triggered by '\input{',
'\include{' commands. '\include{', or '\includeonly{' commands.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Complete include PDF files~ Complete include PDF files~
*vimtex-complete-pdf* *vimtex-complete-pdf*
File name completion for PDF files offered by the `pdfpages` package is File name completion for PDF files offered by the `pdfpages` package is
triggered by '\includepdf{' commands. triggered by '\includepdf{' commands.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Complete include standalone files~ Complete include standalone files~
*vimtex-complete-standalone* *vimtex-complete-standalone*
File name completion for standalone files offered by the package `standalone` File name completion for standalone files offered by the package `standalone`
is triggered by '\includepdf{' commands. is triggered by '\includepdf{' commands.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Complete include glossary entries~ Complete include glossary entries~
*vimtex-complete-standalone* *vimtex-complete-standalone*
Glossary entry completion from the `glossaries` package are triggered by the Glossary entry completion from the `glossaries` package are triggered by the
commands '\gls{', '\glspl{' and their variations. commands '\gls{', '\glspl{' and their variations.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Autocomplete~ Autocomplete~
*vimtex-complete-auto* *vimtex-complete-auto*
Vim does not provide automatic completion by itself, but there exist at least Vim does not provide automatic completion by itself, but there exist at least
two good plugins that provide this: |neocomplete| and |youcompleteme|. Moreover, two good plugins that provide this: |neocomplete| and |youcompleteme|. Moreover,
@ -1525,7 +1525,10 @@ To enable automatic completion with |youcompleteme|, use the following options:
\ 're!\\[A-Za-z]*ref({[^}]*|range{([^,{}]*(}{)?))', \ 're!\\[A-Za-z]*ref({[^}]*|range{([^,{}]*(}{)?))',
\ 're!\\hyperref\[[^]]*', \ 're!\\hyperref\[[^]]*',
\ 're!\\includegraphics\*?(\[[^]]*\]){0,2}{[^}]*', \ 're!\\includegraphics\*?(\[[^]]*\]){0,2}{[^}]*',
\ 're!\\(include(only)?|input){[^}]*' \ 're!\\(include(only)?|input){[^}]*',
\ 're!\\\a*(gls|Gls|GLS)(pl)?\a*(\s*\[[^]]*\]){0,2}\s*\{[^}]*',
\ 're!\\includepdf(\s*\[[^]]*\])?\s*\{[^}]*',
\ 're!\\includestandalone(\s*\[[^]]*\])?\s*\{[^}]*',
\ ] \ ]
< <
VimCompletesMe~ VimCompletesMe~