xref: /vim-8.2.3635/runtime/syntax/config.vim (revision 89bcfda6)
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
38command -nargs=+ HiLink hi def link <args>
39
40HiLink configdelimiter Delimiter
41HiLink configoperator  Operator
42HiLink configcomment   Comment
43HiLink configDnl  	 Comment
44HiLink configfunction  Function
45HiLink confignumber    Number
46HiLink configkeyword   Keyword
47HiLink configspecial   Special
48HiLink configstring    String
49
50delcommand HiLink
51
52let b:current_syntax = "config"
53
54" vim: ts=4
55