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