File: glossaries.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 (44 lines) | stat: -rw-r--r-- 1,522 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve LervÄg
" Email:      karl.yngve@gmail.com
"

scriptencoding utf-8

function! vimtex#syntax#p#glossaries#load(cfg) abort " {{{1
  syntax match texCmd nextgroup=texGlsArg skipwhite skipnl "\\gls\>"
  call vimtex#syntax#core#new_arg('texGlsArg', {'contains': '@NoSpell'})

  " \newacronym -> opt -> arg1 -> arg2 -> arg3
  syntax match texCmdNewAcr "\\newacronym\>"
        \ nextgroup=texNewAcrOpt,texNewAcrArgLabel skipwhite skipnl
  call vimtex#syntax#core#new_opt('texNewAcrOpt', {
        \ 'next': 'texNewAcrArgLabel',
        \})
  call vimtex#syntax#core#new_arg('texNewAcrArgLabel', {
        \ 'next': 'texNewAcrArgAbbr',
        \ 'contains': '@NoSpell',
        \})
  call vimtex#syntax#core#new_arg('texNewAcrArgAbbr', {
        \ 'next': 'texNewAcrArgLong',
        \ 'contains': '@NoSpell',
        \})
  call vimtex#syntax#core#new_arg('texNewAcrArgLong')

  " \acrcmds -> ArgLabel
  syntax match texCmdAcr
        \ "\v\\%(ACR|Acr|acr)%(full|long|short)%(pl)?>"
        \ nextgroup=texAcrArgLabel skipwhite skipnl
  syntax match texCmdAcr "\\acrfullfmt"
        \ nextgroup=texAcrArgLabel skipwhite skipnl
  call vimtex#syntax#core#new_arg('texAcrArgLabel', {'contains': '@NoSpell'})

  highlight def link texCmdAcr         texCmd
  highlight def link texCmdNewAcr      texCmdNew
  highlight def link texNewAcrOpt      texOpt
  highlight def link texNewAcrArgLabel texArg
  highlight def link texAcrArgLabel    texNewAcrArgLabel
endfunction

" }}}1