comparison runtime/syntax/indent.vim @ 375:f14cbd913415 v7.0097

updated for version 7.0097
author vimboss
date Wed, 29 Jun 2005 22:40:58 +0000
parents 3fc0f57ecb91
children 4fe8e1a7758e
comparison
equal deleted inserted replaced
374:575dacb554d8 375:f14cbd913415
1 " Vim syntax file 1 " Vim syntax file
2 " Language: indent RC File 2 " Language: indent(1) configuration file
3 " Maintainer: Nikolai Weibull <source@pcppopper.org> 3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
4 " URL: http://www.pcppopper.org/vim/syntax/pcp/indent/ 4 " Latest Revision: 2005-06-29
5 " Latest Revision: 2004-05-22 5 " indent_is_bsd: If exists, will change somewhat to match BSD implementation
6 " arch-tag: 23c11190-79fa-4493-9fc5-36435402a20d 6 "
7 " TODO: is the deny-all (a la lilo.vim nice or no?)... 7 " TODO: is the deny-all (a la lilo.vim nice or no?)...
8 " irritating to be wrong to the last char... 8 " irritating to be wrong to the last char...
9 " would be sweet if right until one char fails 9 " would be sweet if right until one char fails
10 10
11 if version < 600 11 if exists("b:current_syntax")
12 syntax clear
13 elseif exists("b:current_syntax")
14 finish 12 finish
15 endif 13 endif
16 14
17 " Set iskeyword since we need `-' (and potentially others) in keywords. 15 let s:cpo_save = &cpo
18 " For version 5.x: Set it globally 16 set cpo&vim
19 " For version 6.x: Set it locally 17
20 if version >= 600 18 setlocal iskeyword=@,48-57,-,_
21 command -nargs=1 SetIsk setlocal iskeyword=<args> 19
20 syn match indentError '\S\+'
21
22 syn keyword indentTodo contained TODO FIXME XXX NOTE
23
24 syn region indentComment matchgroup=indentComment
25 \ start='/\*' end='\*/'
26 \ contains=indentTodo,@Spell
27 syn region indentComment matchgroup=indentComment
28 \ start='//' skip='\\$' end='$'
29 \ contains=indentTodo,@Spell
30
31 syn 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
123 syn 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
143 if !exists("indent_is_bsd")
144 syn keyword indentOptions -i --indentation-level
145 \ nextgroup=indentNumber skipwhite
146 endif
147
148 syn match indentNumber display '\<\d\+\>'
149
150 syn keyword indentOptions -T nextgroup=indentIdent skipwhite
151
152 syn match indentIdent display '\<\h\w*\>'
153
154 if exists("indent_is_bsd")
155 syn keyword indentOptions -ip -nip -dj -ndj -ei -nei
156 endif
157
158 if exists("c_minlines")
159 let b:c_minlines = c_minlines
22 else 160 else
23 command -nargs=1 SetIsk set iskeyword=<args> 161 if !exists("c_no_if0")
162 let b:c_minlines = 50 " #if 0 constructs can be long
163 else
164 let b:c_minlines = 15 " mostly for () constructs
165 endif
24 endif 166 endif
25 SetIsk 48-57,65-90,97-122,-,_
26 delcommand SetIsk
27 167
28 " errors 168 hi def link indentError Error
29 syn match indentError "\S\+" 169 hi def link indentComment Comment
30 170 hi def link indentTodo Todo
31 " todo 171 hi def link indentOptions Keyword
32 syn keyword indentTodo contained TODO FIXME XXX NOTE 172 hi def link indentNumber Number
33 173 hi def link indentIdent Identifier
34 " comments
35 syn region indentComment matchgroup=indentComment start="/\*" end="\*/" contains=indentTodo
36
37 " keywords (command-line switches)
38 syn match indentOptions "\<--\(no-\)\=blank-\(before-sizeof\|Bill-Shannon\|lines-\(after-\(commas\|declarations\|procedures\)\|before-block-comments\)\)\>"
39 syn match indentOptions "\<--brace-indent\s*\d\+\>"
40 syn match indentOptions "\<--braces-\(after\|on\)-\(if\|struct-decl\)-line\>"
41 syn match indentOptions "\<--break-\(\(after\|before\)-boolean-operator\|function-decl-args\)\>"
42 syn match indentOptions "\<--\(case\(-brace\)\=\|comment\|continuation\|declaration\|line-comments\|parameter\|paren\|struct-brace\)-indentation\s*\d\+\>"
43 syn match indentOptions "\<--\(no-\)\=comment-delimiters-on-blank-lines\>"
44 syn match indentOptions "\<--\(dont-\)\=cuddle-\(do-while\|else\)\>"
45 syn match indentOptions "\<--\(declaration-comment\|else-endif\)-column\s*\d\+\>"
46 syn match indentOptions "\<--dont-break-\(function-decl-args\|procedure-type\)\>"
47 syn match indentOptions "\<--\(dont-\)\=\(format\(-first-column\)\=\|star\)-comments\>"
48 syn match indentOptions "\<--\(honour\|ignore\)-newlines\>"
49 syn match indentOptions "\<--\(indent-level\|\(comment-\)\=line-length\)\s*\d\+\>"
50 syn match indentOptions "\<--\(leave\|remove\)-preprocessor-space\>"
51 "not 100%, since casts\= should always be cast if no- isn't given
52 syn match indentOptions "\<--\(no-\)\=space-after-\(parentheses\|casts\=\|for\|if\|while\)\>"
53 syn match indentOptions "\<--\(dont-\)\=space-special-semicolon\>"
54 syn match indentOptions "\<--\(leave\|swallow\)-optional-blank-lines\>"
55 syn match indentOptions "\<--tab-size\s*\d\+\>"
56 syn match indentOptions "\<--\(no\|use\)-tabs\>"
57 syn keyword indentOptions --gnu-style --ignore-profile --k-and-r-style --original
58 syn keyword indentOptions --preserve-mtime --no-verbosity --verbose --output-file
59 syn keyword indentOptions --no-parameter-indentation --procnames-start-lines
60 syn keyword indentOptions --standard-output --start-left-side-of-comments
61 syn keyword indentOptions --space-after-procedure-calls
62 " this also here since the gnu indent fellas aren't consistent. (ever read
63 " the code to `indent'? you'll know what i mean if you have)
64 syn match indentOptions "\<-\(bli\|cbi\|cd\|ci\|cli\|c\|cp\|di\|d\|i\|ip\|l\|lc\|pi\|sbi\|ts\)\s*\d\+\>"
65 syn match indentOptions "\<-T\s\+\w\+\>"
66 syn keyword indentOptions --format-all-comments --continue-at-parentheses --dont-line-up-parentheses
67 syn keyword indentOptions --no-space-after-function-call-names
68 syn keyword indentOptions -bad -bap -bbb -bbo -bc -bfda -bl -br -bs -nbs -cdb -cdw -ce -cs -dce -fc1 -fca
69 syn keyword indentOptions -gnu -hnl -kr -lp -lps -nbad -nbap -nbbb -nbbo -nbc -nbfda -ncdb -ncdw -nprs
70 syn keyword indentOptions -nce -ncs -nfc1 -nfca -nhnl -nip -nlp -nlps -npcs -npmt -npro -npsl -nsaf -nsai
71 syn keyword indentOptions -nsaw -nsc -nsob -nss -nv -o -orig -pcs -pmt -prs -psl -saf -sai -saw -sc
72 syn keyword indentOptions -sob -ss -st -v -version -bls -brs -ut -nut
73
74 if exists("indent_minlines")
75 let b:indent_minlines = indent_minlines
76 else
77 let b:indent_minlines = 50
78 endif
79 exec "syn sync minlines=" . b:indent_minlines
80
81 " Define the default highlighting.
82 " For version 5.7 and earlier: only when not done already
83 " For version 5.8 and later: only when an item doesn't have highlighting yet
84 if version >= 508 || !exists("did_indent_syn_inits")
85 if version < 508
86 let did_indent_syn_inits = 1
87 command -nargs=+ HiLink hi link <args>
88 else
89 command -nargs=+ HiLink hi def link <args>
90 endif
91
92 HiLink indentError Error
93 HiLink indentComment Comment
94 HiLink indentTodo Todo
95 HiLink indentOptions Keyword
96 delcommand HiLink
97 endif
98 174
99 let b:current_syntax = "indent" 175 let b:current_syntax = "indent"
100 176
101 " vim: set sts=2 sw=2: 177 let &cpo = s:cpo_save
178 unlet s:cpo_save