1
+
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'autodoc') == -1
2
+
3
+
" Vim syntax file
4
+
" Language: Autodoc
5
+
" Maintainer: Stephen R. van den Berg <srb@cuci.nl>
6
+
" Last Change: 2018 Jan 23
7
+
" Version: 2.9
8
+
" Remark: Included by pike.vim, cmod.vim and optionally c.vim
9
+
" Remark: In order to make c.vim use it, set: c_autodoc
10
+
11
+
" Quit when a (custom) syntax file was already loaded
12
+
if exists("b:current_syntax")
13
+
finish
14
+
endif
15
+
16
+
let s:cpo_save = &cpo
17
+
set cpo&vim
18
+
19
+
syn case match
20
+
21
+
" A bunch of useful autodoc keywords
22
+
syn keyword autodocStatement contained appears belongs global
23
+
syn keyword autodocStatement contained decl directive inherit
24
+
syn keyword autodocStatement contained deprecated obsolete bugs
25
+
syn keyword autodocStatement contained copyright example fixme note param returns
26
+
syn keyword autodocStatement contained seealso thanks throws constant
27
+
syn keyword autodocStatement contained member index elem
28
+
syn keyword autodocStatement contained value type item
29
+
30
+
syn keyword autodocRegion contained enum mapping code multiset array
31
+
syn keyword autodocRegion contained int string section mixed ol ul dl
32
+
syn keyword autodocRegion contained class module namespace
33
+
syn keyword autodocRegion contained endenum endmapping endcode endmultiset
34
+
syn keyword autodocRegion contained endarray endint endstring endsection
35
+
syn keyword autodocRegion contained endmixed endol endul enddl
36
+
syn keyword autodocRegion contained endclass endmodule endnamespace
37
+
38
+
syn keyword autodocIgnore contained ignore endignore
39
+
40
+
syn keyword autodocStatAcc contained b i u tt url pre sub sup
41
+
syn keyword autodocStatAcc contained ref rfc xml dl expr image
42
+
43
+
syn keyword autodocTodo contained TODO FIXME XXX
44
+
45
+
syn match autodocLineStart display "\(//\|/\?\*\)\@2<=!"
46
+
syn match autodocWords "[^!@{}[\]]\+" display contains=@Spell
47
+
48
+
syn match autodocLink "@\[[^[\]]\+]"hs=s+2,he=e-1 display contains=autodocLead
49
+
syn match autodocAtStmt "@[a-z]\+\%(\s\|$\)\@="hs=s+1 display contains=autodocStatement,autodocIgnore,autodocLead,autodocRegion
50
+
51
+
" Due to limitations of the matching algorithm, we cannot highlight
52
+
" nested autodocNStmtAcc structures correctly
53
+
syn region autodocNStmtAcc start="@[a-z]\+{" end="@}" contains=autodocStatAcc,autodocLead keepend
54
+
55
+
syn match autodocUrl contained display ".\+"
56
+
syn region autodocAtUrlAcc start="{"ms=s+1 end="@}"he=e-1,me=e-2 contained display contains=autodocUrl,autodocLead keepend
57
+
syn region autodocNUrlAcc start="@url{" end="@}" contains=autodocStatAcc,autodocAtUrlAcc,autodocLead transparent
58
+
59
+
syn match autodocSpecial "@@" display
60
+
syn match autodocLead "@" display contained
61
+
62
+
"when wanted, highlight trailing white space
63
+
if exists("c_space_errors")
64
+
if !exists("c_no_trail_space_error")
65
+
syn match autodocSpaceError display excludenl "\s\+$"
66
+
endif
67
+
if !exists("c_no_tab_space_error")
68
+
syn match autodocSpaceError display " \+\t"me=e-1
69
+
endif
70
+
endif
71
+
72
+
if exists("c_minlines")
73
+
let b:c_minlines = c_minlines
74
+
else
75
+
if !exists("c_no_if0")
76
+
let b:c_minlines = 50 " #if 0 constructs can be long
77
+
else
78
+
let b:c_minlines = 15 " mostly for () constructs
79
+
endif
80
+
endif
81
+
exec "syn sync ccomment autodocComment minlines=" . b:c_minlines
82
+
83
+
" Define the default highlighting.
84
+
" Only used when an item doesn't have highlighting yet
85
+
hi def link autodocStatement Statement
86
+
hi def link autodocStatAcc Statement
87
+
hi def link autodocRegion Structure
88
+
hi def link autodocAtStmt Error
89
+
hi def link autodocNStmtAcc Identifier
90
+
hi def link autodocLink Type
91
+
hi def link autodocTodo Todo
92
+
hi def link autodocSpaceError Error
93
+
hi def link autodocLineStart SpecialComment
94
+
hi def link autodocSpecial SpecialChar
95
+
hi def link autodocUrl Underlined
96
+
hi def link autodocLead Statement
97
+
hi def link autodocIgnore Delimiter
98
+
99
+
let b:current_syntax = "autodoc"
100
+
101
+
let &cpo = s:cpo_save
102
+
unlet s:cpo_save
103
+
" vim: ts=8
104
+
105
+
endif
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4