File: pgfplots.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 (60 lines) | stat: -rw-r--r-- 2,453 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
48
49
50
51
52
53
54
55
56
57
58
59
60
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve LervÄg
" Email:      karl.yngve@gmail.com
"

function! vimtex#syntax#p#pgfplots#load(cfg) abort " {{{1
  call vimtex#syntax#packages#load('tikz')

  syntax cluster texClusterTikz add=texCmdAxis

  syntax match texCmdTikzset nextgroup=texTikzsetArg skipwhite "\\pgfplotsset\>"

  syntax match texTikzEnvBgn contains=texCmdEnv nextgroup=texTikzOpt skipwhite skipnl "\\begin{\%(log\)*axis}"
  syntax match texTikzEnvBgn contains=texCmdEnv nextgroup=texTikzOpt skipwhite skipnl "\\begin{groupplot}"
  for l:env in ['axis', 'logaxis', 'loglogaxis', 'groupplot']
    call vimtex#syntax#core#new_env({
          \ 'name': l:env,
          \ 'region': 'texTikzZone',
          \ 'contains': '@texClusterTikz',
          \ 'transparent': v:true,
          \})
  endfor


  syntax match texCmdAxis contained nextgroup=texTikzOpt skipwhite skipnl "\\nextgroupplot\>"
  syntax match texCmdAxis contained nextgroup=texPgfAddplotOpt,texPgfType,texPgfFunc skipwhite skipnl "\\addplot3\?\>+\?"

  call vimtex#syntax#core#new_opt('texPgfAddplotOpt', {'contains': '@texClusterTikzset', 'next': 'texPgfType,texPgfFunc'})
  call vimtex#syntax#core#new_arg('texPgfFunc', {'contains': '', 'opts': 'contained transparent'})


  syntax match texPgfType "table" contained nextgroup=texPgfTableOpt,texPgfTableArg skipwhite skipnl
  call vimtex#syntax#core#new_opt('texPgfTableOpt', {'contains': '@texClusterTikzset'})
  call vimtex#syntax#core#new_arg('texPgfTableArg', {'contains': '@NoSpell,texComment'})


  syntax match texPgfType "gnuplot" contained nextgroup=texPgfGnuplotArg skipwhite skipnl
  call vimtex#syntax#nested#include('gnuplot')
  call vimtex#syntax#core#new_arg('texPgfGnuplotArg', {'contains': '@vimtex_nested_gnuplot', 'next': 'texPgfNode'})


  syntax match texPgfType "coordinates" contained nextgroup=texPgfCoordinates skipwhite skipnl
  call vimtex#syntax#core#new_arg('texPgfCoordinates', {'contains': ''})


  syntax match texPgfNode "node" contained nextgroup=texTikzNodeOpt skipwhite skipnl


  highlight def link texCmdAxis        texCmd
  highlight def link texPgfNode        texCmd
  highlight def link texPgfType        texMathDelim
  highlight def link texPgfFunc        texArg
  highlight def link texPgfTableArg    texFileArg
  highlight def link texPgfCoordinates texOpt
  highlight def link texPgfAddplotOpt  texOpt
  highlight def link texPgfTableOpt    texOpt
endfunction

" }}}1