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