Alter regex for \ref to provide completion for most cleveref commands.

This commit is contained in:
David Tracey 2016-02-14 01:27:36 +00:00
parent afc7a86833
commit c6596503a8
2 changed files with 5 additions and 3 deletions

View File

@ -223,7 +223,7 @@ endfunction
" {{{1 Labels
let s:ref = {
\ 'pattern' : '\v\\v?%(auto|eq|page|[cC]|labelc)?ref\s*\{[^{}]*',
\ 'pattern' : '\v\\v?%(auto|eq|[cC]?%(page)?|labelc)?%(ref)%(\s*\{[^\{\}]*|%(range)\s*\{[^,\{\}]*%(\}\{)?)',
\ 'enabled' : 1,
\}

View File

@ -1387,7 +1387,8 @@ documents with |neocomplete| and |vimtex|s omni completion function: >
endif
let g:neocomplete#sources#omni#input_patterns.tex =
\ '\v\\%('
\ . '\a*%(ref|cite)\a*%(\s*\[[^]]*\])?\s*\{[^{}]*'
\ . '\a*%(cite)\a*%(\s*\[[^\{\}\]]*\]){0,2}\s*\{[^\{\}]*'
\ . '\a*%(ref)%(\s*\{[^\{\}]*|%(range)\s*\{[^,\{\}]*%(\}\{)?)'
\ . '|includegraphics%(\s*\[[^]]*\])?\s*\{[^{}]*'
\ . '|%(include|input)\s*\{[^{}]*'
\ . ')'
@ -1413,7 +1414,8 @@ To enable automatic completion with |youcompleteme|, use the following options:
let g:ycm_semantic_triggers = {}
endif
let g:ycm_semantic_triggers.tex = [
\ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*,?)*',
\ 're!\\[A-Za-z]*(cite)[A-Za-z]*(\[[^\{\}\]]*\]){0,2}\{[^\{\}]*',
\ 're!\\[A-Za-z]*(ref)(\{[^\{\}]*|(range)\{([^,\{\}]*(\}\{)?))',
\ 're!\\includegraphics([^]]*])?{[^}]*',
\ 're!\\(include|input){[^}]*'
\ ]