File: glossaries.vim

package info (click to toggle)
vim-vimtex 2.17-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,844 kB
  • sloc: makefile: 360; python: 103
file content (47 lines) | stat: -rw-r--r-- 1,649 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
45
46
47
" 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 texCmdGls "\v\c\\gls%(desc|link|pl)?>"
        \ nextgroup=texGlsArg skipwhite skipnl
  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 texCmdGls         texCmd
  highlight def link texGlsArg         texRefArg
  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