blob: ef4df5f5cc11c7af3465f737ca199be7d4a37fec [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaar42eeac32005-06-29 22:40:58 +00002" Language: indent(1) configuration file
Bram Moolenaar57657d82006-04-21 22:12:41 +00003" Maintainer: Nikolai Weibull <now@bitwi.se>
4" Latest Revision: 2006-04-19
Bram Moolenaar42eeac32005-06-29 22:40:58 +00005" indent_is_bsd: If exists, will change somewhat to match BSD implementation
6"
Bram Moolenaar071d4272004-06-13 20:20:40 +00007" TODO: is the deny-all (a la lilo.vim nice or no?)...
Bram Moolenaar42eeac32005-06-29 22:40:58 +00008" irritating to be wrong to the last char...
9" would be sweet if right until one char fails
Bram Moolenaar071d4272004-06-13 20:20:40 +000010
Bram Moolenaar42eeac32005-06-29 22:40:58 +000011if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000012 finish
13endif
14
Bram Moolenaar42eeac32005-06-29 22:40:58 +000015let s:cpo_save = &cpo
16set cpo&vim
17
Bram Moolenaar57657d82006-04-21 22:12:41 +000018setlocal iskeyword=@,48-57,-,+,_
Bram Moolenaar42eeac32005-06-29 22:40:58 +000019
20syn match indentError '\S\+'
21
22syn keyword indentTodo contained TODO FIXME XXX NOTE
23
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000024syn region indentComment start='/\*' end='\*/'
Bram Moolenaar42eeac32005-06-29 22:40:58 +000025 \ contains=indentTodo,@Spell
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000026syn region indentComment start='//' skip='\\$' end='$'
Bram Moolenaar42eeac32005-06-29 22:40:58 +000027 \ 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000144endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000145
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000146syn match indentNumber display '\<\d\+\>'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000147
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000148syn keyword indentOptions -T nextgroup=indentIdent skipwhite
Bram Moolenaar071d4272004-06-13 20:20:40 +0000149
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000150syn match indentIdent display '\<\h\w*\>'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000152if exists("indent_is_bsd")
153 syn keyword indentOptions -ip -nip -dj -ndj -ei -nei
Bram Moolenaar071d4272004-06-13 20:20:40 +0000154endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000156if 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161 else
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000162 let b:c_minlines = 15 " mostly for () constructs
Bram Moolenaar071d4272004-06-13 20:20:40 +0000163 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000164endif
165
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000166hi 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000173let b:current_syntax = "indent"
174
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000175let &cpo = s:cpo_save
176unlet s:cpo_save