File: mleftright.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 (68 lines) | stat: -rw-r--r-- 3,767 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
61
62
63
64
65
66
67
68
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email:      karl.yngve@gmail.com
"

scriptencoding utf-8

function! vimtex#syntax#p#mleftright#load(cfg) abort " {{{1
  syntax match texMathDelimMod contained "\\m\(left\|right\)\>"

  " Add conceal rules
  if !g:vimtex_syntax_conceal.math_delimiters || &encoding !=# 'utf-8'
    return
  endif

  syntax match texMathDelim contained conceal cchar=| "\\mleft\\lvert"
  syntax match texMathDelim contained conceal cchar=| "\\mright\\rvert"
  syntax match texMathDelim contained conceal cchar=‖ "\\mleft\\lVert"
  syntax match texMathDelim contained conceal cchar=‖ "\\mright\\rVert"

  syntax match texMathDelim contained conceal cchar=| "\\mleft|"
  syntax match texMathDelim contained conceal cchar=| "\\mright|"
  syntax match texMathDelim contained conceal cchar=‖ "\\mleft\\|"
  syntax match texMathDelim contained conceal cchar=‖ "\\mright\\|"
  syntax match texMathDelim contained conceal cchar=( "\\mleft("
  syntax match texMathDelim contained conceal cchar=) "\\mright)"
  syntax match texMathDelim contained conceal cchar=[ "\\mleft\["
  syntax match texMathDelim contained conceal cchar=] "\\mright]"
  syntax match texMathDelim contained conceal cchar={ "\\mleft\\{"
  syntax match texMathDelim contained conceal cchar=} "\\mright\\}"
  syntax match texMathDelim contained conceal cchar=< "\\mleft<"
  syntax match texMathDelim contained conceal cchar=> "\\mright>"
  syntax match texMathDelim contained conceal cchar=( "\\mleft("
  syntax match texMathDelim contained conceal cchar=) "\\mright)"
  syntax match texMathDelim contained conceal cchar=[ "\\mleft\["
  syntax match texMathDelim contained conceal cchar=] "\\mright]"
  syntax match texMathDelim contained conceal cchar={ "\\mleft\\{"
  syntax match texMathDelim contained conceal cchar=} "\\mright\\}"
  syntax match texMathDelim contained conceal cchar=[ "\\mleft\\lbrace\>"
  syntax match texMathDelim contained conceal cchar=⌈ "\\mleft\\lceil\>"
  syntax match texMathDelim contained conceal cchar=⌊ "\\mleft\\lfloor\>"
  syntax match texMathDelim contained conceal cchar=⌊ "\\mleft\\lgroup\>"
  syntax match texMathDelim contained conceal cchar=⎛ "\\mleft\\lmoustache\>"
  syntax match texMathDelim contained conceal cchar=] "\\mright\\rbrace\>"
  syntax match texMathDelim contained conceal cchar=⌉ "\\mright\\rceil\>"
  syntax match texMathDelim contained conceal cchar=⌋ "\\mright\\rfloor\>"
  syntax match texMathDelim contained conceal cchar=⌋ "\\mright\\rgroup\>"
  syntax match texMathDelim contained conceal cchar=⎞ "\\mright\\rmoustache\>"
  syntax match texMathDelim contained conceal cchar=| "\\m\(left\|right\)|"
  syntax match texMathDelim contained conceal cchar=‖ "\\m\(left\|right\)\\|"
  syntax match texMathDelim contained conceal cchar=↓ "\\m\(left\|right\)\\downarrow\>"
  syntax match texMathDelim contained conceal cchar=⇓ "\\m\(left\|right\)\\Downarrow\>"
  syntax match texMathDelim contained conceal cchar=↑ "\\m\(left\|right\)\\uparrow\>"
  syntax match texMathDelim contained conceal cchar=↑ "\\m\(left\|right\)\\Uparrow\>"
  syntax match texMathDelim contained conceal cchar=↕ "\\m\(left\|right\)\\updownarrow\>"
  syntax match texMathDelim contained conceal cchar=⇕ "\\m\(left\|right\)\\Updownarrow\>"

  if &ambiwidth ==# 'double'
    syntax match texMathDelim contained conceal cchar=〈 "\\\%([bB]igg\?l\?\|left\)\\langle\>"
    syntax match texMathDelim contained conceal cchar=〉 "\\\%([bB]igg\?r\?\|right\)\\rangle\>"
  else
    syntax match texMathDelim contained conceal cchar=⟨ "\\\%([bB]igg\?l\?\|left\)\\langle\>"
    syntax match texMathDelim contained conceal cchar=⟩ "\\\%([bB]igg\?r\?\|right\)\\rangle\>"
  endif
endfunction

" }}}1