xref: /vim-8.2.3635/runtime/syntax/indent.vim (revision 044b68f4)
1" Vim syntax file
2" Language:         indent(1) configuration file
3" Maintainer:       Nikolai Weibull <[email protected]>
4" Latest Revision:  2006-04-19
5"   indent_is_bsd:  If exists, will change somewhat to match BSD implementation
6"
7" TODO: is the deny-all (a la lilo.vim nice or no?)...
8"       irritating to be wrong to the last char...
9"       would be sweet if right until one char fails
10
11if exists("b:current_syntax")
12  finish
13endif
14
15let s:cpo_save = &cpo
16set cpo&vim
17
18setlocal iskeyword=@,48-57,-,+,_
19
20syn match   indentError   '\S\+'
21
22syn keyword indentTodo    contained TODO FIXME XXX NOTE
23
24syn region  indentComment start='/\*' end='\*/'
25                          \ contains=indentTodo,@Spell
26syn region  indentComment start='//' skip='\\$' end='$'
27                          \ contains=indentTodo,@Spell
28
29syn keyword indentOptions -bacc --blank-lines-after-ifdefs
30                        \ -bad --blank-lines-after-declarations
31                        \ -badp --blank-lines-after-procedure-declarations
32                        \ -bap --blank-lines-after-procedures
33                        \ -bbb --blank-lines-before-block-comments
34                        \ -bbo --break-before-boolean-operator
35                        \ -bc --blank-lines-after-commas
36                        \ -bfda --break-function-decl-args
37                        \ -bfde --break-function-decl-args-end
38                        \ -bl --braces-after-if-line
39                        \ -blf --braces-after-func-def-line
40                        \ -bls --braces-after-struct-decl-line
41                        \ -br --braces-on-if-line
42                        \ -brf --braces-on-func-def-line
43                        \ -brs --braces-on-struct-decl-line
44                        \ -bs --Bill-Shannon
45                        \ -bs --blank-before-sizeof
46                        \ -c++ --c-plus-plus
47                        \ -cdb --comment-delimiters-on-blank-lines
48                        \ -cdw --cuddle-do-while
49                        \ -ce --cuddle-else
50                        \ -cs --space-after-cast
51                        \ -dj --left-justify-declarations
52                        \ -eei --extra-expression-indentation
53                        \ -fc1 --format-first-column-comments
54                        \ -fca --format-all-comments
55                        \ -gnu --gnu-style
56                        \ -h --help
57                        \ -h --usage
58                        \ -hnl --honour-newlines
59                        \ -kr --k-and-r-style
60                        \ -kr --kernighan-and-ritchie
61                        \ -kr --kernighan-and-ritchie-style
62                        \ -lp --continue-at-parentheses
63                        \ -lps --leave-preprocessor-space
64                        \ -nbacc --no-blank-lines-after-ifdefs
65                        \ -nbad --no-blank-lines-after-declarations
66                        \ -nbadp --no-blank-lines-after-procedure-declarations
67                        \ -nbap --no-blank-lines-after-procedures
68                        \ -nbbb --no-blank-lines-before-block-comments
69                        \ -nbbo --break-after-boolean-operator
70                        \ -nbc --no-blank-lines-after-commas
71                        \ -nbfda --dont-break-function-decl-args
72                        \ -nbfde --dont-break-function-decl-args-end
73                        \ -nbs --no-Bill-Shannon
74                        \ -nbs --no-blank-before-sizeof
75                        \ -ncdb --no-comment-delimiters-on-blank-lines
76                        \ -ncdw --dont-cuddle-do-while
77                        \ -nce --dont-cuddle-else
78                        \ -ncs --no-space-after-casts
79                        \ -ndj --dont-left-justify-declarations
80                        \ -neei --no-extra-expression-indentation
81                        \ -nfc1 --dont-format-first-column-comments
82                        \ -nfca --dont-format-comments
83                        \ -nhnl --ignore-newlines
84                        \ -nip --dont-indent-parameters
85                        \ -nip --no-parameter-indentation
86                        \ -nlp --dont-line-up-parentheses
87                        \ -nlps --remove-preprocessor-space
88                        \ -npcs --no-space-after-function-call-names
89                        \ -npro --ignore-profile
90                        \ -nprs --no-space-after-parentheses
91                        \ -npsl --dont-break-procedure-type
92                        \ -nsaf --no-space-after-for
93                        \ -nsai --no-space-after-if
94                        \ -nsaw --no-space-after-while
95                        \ -nsc --dont-star-comments
96                        \ -nsob --leave-optional-blank-lines
97                        \ -nss --dont-space-special-semicolon
98                        \ -nut --no-tabs
99                        \ -nv --no-verbosity
100                        \ -o --output
101                        \ -o --output-file
102                        \ -orig --berkeley
103                        \ -orig --berkeley-style
104                        \ -orig --original
105                        \ -orig --original-style
106                        \ -pcs --space-after-procedure-calls
107                        \ -pmt --preserve-mtime
108                        \ -prs --space-after-parentheses
109                        \ -psl --procnames-start-lines
110                        \ -saf --space-after-for
111                        \ -sai --space-after-if
112                        \ -saw --space-after-while
113                        \ -sc --start-left-side-of-comments
114                        \ -sob --swallow-optional-blank-lines
115                        \ -ss --space-special-semicolon
116                        \ -st --standard-output
117                        \ -ut --use-tabs
118                        \ -v --verbose
119                        \ -version --version
120
121syn keyword indentOptions -bli --brace-indent
122                        \ -c --comment-indentation
123                        \ -bli --brace-indent
124                        \ -c --comment-indentation
125                        \ -cbi --case-brace-indentation
126                        \ -cd --declaration-comment-column
127                        \ -ci --continuation-indentation
128                        \ -cli --case-indentation
129                        \ -cp --else-endif-column
130                        \ -d --line-comments-indentation
131                        \ -di --declaration-indentation
132                        \ -i --indent-level
133                        \ -ip --parameter-indentation
134                        \ -l --line-length
135                        \ -lc --comment-line-length
136                        \ -pi --paren-indentation
137                        \ -ppi --preprocessor-indentation
138                        \ -sbi --struct-brace-indentation
139                        \ -ts --tab-size
140                        \ nextgroup=indenNumber skipwhite
141if !exists("indent_is_bsd")
142  syn keyword indentOptions -i --indentation-level
143                          \ nextgroup=indentNumber skipwhite
144endif
145
146syn match   indentNumber  display '\<\d\+\>'
147
148syn keyword indentOptions -T nextgroup=indentIdent skipwhite
149
150syn match   indentIdent   display '\<\h\w*\>'
151
152if exists("indent_is_bsd")
153  syn keyword indentOptions -ip -nip -dj -ndj -ei -nei
154endif
155
156if exists("c_minlines")
157  let b:c_minlines = c_minlines
158else
159  if !exists("c_no_if0")
160    let b:c_minlines = 50       " #if 0 constructs can be long
161  else
162    let b:c_minlines = 15       " mostly for () constructs
163  endif
164endif
165
166hi def link indentError   Error
167hi def link indentComment Comment
168hi def link indentTodo    Todo
169hi def link indentOptions Keyword
170hi def link indentNumber  Number
171hi def link indentIdent   Identifier
172
173let b:current_syntax = "indent"
174
175let &cpo = s:cpo_save
176unlet s:cpo_save
177