File: natbib.vim

package info (click to toggle)
vim-vimtex 2.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,660 kB
  • sloc: makefile: 367; python: 103
file content (27 lines) | stat: -rw-r--r-- 1,210 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve LervÄg
" Email:      karl.yngve@gmail.com
"

function! vimtex#syntax#p#natbib#load(cfg) abort " {{{1
  syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\\Cite[pt]\?\>\*\?"
  syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\\[cC]iteal[tp]\>\*\?"
  syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\\cite\%(num\|text\|url\)\>"
  syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\\[Cc]ite\%(title\|author\|year\%(par\)\?\|date\)\>\*\?"

  if !g:vimtex_syntax_conceal.cites | return | endif

  if g:vimtex_syntax_conceal_cites.type ==# 'brackets'
    syntax match texCmdRefConcealed "\v\\Cite[t]?>\*?" conceal
          \ skipwhite nextgroup=texRefConcealedOpt1,texRefConcealedArg
    syntax match texCmdRefConcealed "\v\\Citep>\*?" conceal
          \ skipwhite nextgroup=texRefConcealedPOpt1,texRefConcealedPArg
  elseif !empty(g:vimtex_syntax_conceal_cites.icon)
    execute 'syntax match texCmdRefConcealed'
          \ '"\v\\Cite[tp]?>\*?%(\[[^]]*\]){,2}\{[^}]*\}"'
          \ 'conceal cchar=' . g:vimtex_syntax_conceal_cites.icon
  endif
endfunction

" }}}1