File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ # https://www.latex-project.org/
2
+ #
3
+
4
+ # Detection
5
+ # ‾‾‾‾‾‾‾‾‾
6
+
7
+ hook global BufSetOption mimetype=text/x-tex %{
8
+ set buffer filetype latex
9
+ }
10
+
11
+ hook global BufCreate .*\.tex %{
12
+ set buffer filetype latex
13
+ }
14
+
15
+ # Highlighters
16
+ # ‾‾‾‾‾‾‾‾‾‾‾‾
17
+
18
+ addhl -group / regions -default content latex \
19
+ comment ' ^%' ' \n' ' '
20
+
21
+ addhl -group /latex/comment fill comment
22
+ # Scopes, starting with a backslash
23
+ addhl -group /latex/content regex ' \\\w+\>' 0 :keyword
24
+ # Options passed to scopes, between brackets
25
+ addhl -group /latex/content regex ' \\\w+\>\[([^]]+)\]' 1 :value
26
+ # Content between dollar signs/pairs
27
+ addhl -group /latex/content regex ' \$\$?[^$]+\$\$?' 0 :magenta
28
+ # Emphasized text
29
+ addhl -group /latex/content regex ' \\(emph|textit)\{([^}]+)\}' 2 :default +i
30
+ # Bold text
31
+ addhl -group /latex/content regex ' \\textbf\{([^}]+)\}' 1 :default +b
32
+
33
+ # Initialization
34
+ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
35
+
36
+ hook global WinSetOption filetype =latex %{
37
+ addhl ref latex
38
+
39
+ set window comment_line_chars ' %'
40
+ }
41
+
42
+ hook global WinSetOption filetype =(?!latex).* %{
43
+ rmhl latex
44
+ }
You can’t perform that action at this time.
0 commit comments