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