7
|
1 " Vim syntax file
|
|
2 " Language: configure.in script: M4 with sh
|
|
3 " Maintainer: Christian Hammesr <ch@lathspell.westend.com>
|
6505
|
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
|
7
|
|
8 " Well, I actually even do not know much about m4. This explains why there
|
|
9 " is probably very much missing here, yet !
|
6505
|
10 " But I missed good highlighting when editing my GNU autoconf/automake
|
7
|
11 " script, so I wrote this quick and dirty patch.
|
|
12
|
|
13
|
|
14 " For version 5.x: Clear all syntax items
|
|
15 " For version 6.x: Quit when a syntax file was already loaded
|
|
16 if version < 600
|
|
17 syntax clear
|
|
18 elseif exists("b:current_syntax")
|
|
19 finish
|
|
20 endif
|
|
21
|
|
22 " define the config syntax
|
|
23 syn match configdelimiter "[()\[\];,]"
|
|
24 syn match configoperator "[=|&\*\+\<\>]"
|
6505
|
25 syn match configcomment "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
|
7
|
26 syn match configfunction "\<[A-Z_][A-Z0-9_]*\>"
|
|
27 syn match confignumber "[-+]\=\<\d\+\(\.\d*\)\=\>"
|
6505
|
28 syn keyword configDnl dnl contained
|
7
|
29 syn keyword configkeyword if then else fi test for in do done
|
|
30 syn keyword configspecial cat rm eval
|
6505
|
31
|
|
32 " This shortens the script, see syn-ext-match..
|
|
33 syn region configstring start=+\z(["'`]\)+ skip=+\\\z1+ end=+\z1+ contains=@Spell
|
|
34
|
|
35 " Anything inside AC_MSG_TYPE([...]) and AC_MSG_TYPE(...) is a string.
|
|
36 syn region configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" matchgroup=configdelimiter end="\])" contains=configdelimiter,@Spell
|
|
37 syn region configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
|
7
|
38
|
|
39 " Define the default highlighting.
|
|
40 " For version 5.7 and earlier: only when not done already
|
|
41 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
42 if version >= 508 || !exists("did_config_syntax_inits")
|
|
43 if version < 508
|
|
44 let did_config_syntax_inits = 1
|
|
45 command -nargs=+ HiLink hi link <args>
|
|
46 else
|
|
47 command -nargs=+ HiLink hi def link <args>
|
|
48 endif
|
|
49
|
|
50 HiLink configdelimiter Delimiter
|
|
51 HiLink configoperator Operator
|
|
52 HiLink configcomment Comment
|
6505
|
53 HiLink configDnl Comment
|
7
|
54 HiLink configfunction Function
|
|
55 HiLink confignumber Number
|
|
56 HiLink configkeyword Keyword
|
|
57 HiLink configspecial Special
|
|
58 HiLink configstring String
|
|
59
|
|
60 delcommand HiLink
|
|
61 endif
|
|
62
|
|
63 let b:current_syntax = "config"
|
|
64
|
|
65 " vim: ts=4
|