xref: /vim-8.2.3635/runtime/syntax/config.vim (revision bb76f24a)
1" Vim syntax file
2" Language:		configure.in script: M4 with sh
3" Maintainer:	Christian Hammesr <[email protected]>
4" Last Change:	2015 Jan 14
5" 				(patch from Yngve Inntjore Levinsen to detect AC_MSG)
6" 				(patch from Khym Chanur to add @Spell)
7
8" Well, I actually even do not know much about m4. This explains why there
9" is probably very much missing here, yet !
10" But I missed good highlighting when editing my GNU autoconf/automake
11" script, so I wrote this quick and dirty patch.
12
13
14" quit when a syntax file was already loaded
15if exists("b:current_syntax")
16  finish
17endif
18
19" define the config syntax
20syn match   configdelimiter "[()\[\];,]"
21syn match   configoperator  "[=|&\*\+\<\>]"
22syn match   configcomment   "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
23syn match   configfunction  "\<[A-Z_][A-Z0-9_]*\>"
24syn match   confignumber    "[-+]\=\<\d\+\(\.\d*\)\=\>"
25syn keyword configDnl   	dnl contained
26syn keyword configkeyword   if then else fi test for in do done
27syn keyword configspecial   cat rm eval
28
29" This shortens the script, see syn-ext-match..
30syn region  configstring    start=+\z(["'`]\)+ skip=+\\\z1+ end=+\z1+ contains=@Spell
31
32" Anything inside AC_MSG_TYPE([...])  and AC_MSG_TYPE(...) is a string.
33syn region  configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" matchgroup=configdelimiter end="\])" contains=configdelimiter,@Spell
34syn region  configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
35
36" Define the default highlighting.
37" Only when an item doesn't have highlighting yet
38
39hi def link configdelimiter Delimiter
40hi def link configoperator  Operator
41hi def link configcomment   Comment
42hi def link configDnl  	 Comment
43hi def link configfunction  Function
44hi def link confignumber    Number
45hi def link configkeyword   Keyword
46hi def link configspecial   Special
47hi def link configstring    String
48
49
50let b:current_syntax = "config"
51
52" vim: ts=4
53