blob: c6d4e6b3633d59c4d17eb1fa66f7097cfb6b8c64 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: configure.in script: M4 with sh
3" Maintainer: Christian Hammesr <ch@lathspell.westend.com>
Bram Moolenaar83caecf2015-01-14 19:42:21 +01004" Last Change: 2015 Jan 14
5" (patch from Yngve Inntjore Levinsen to detect AC_MSG)
6" (patch from Khym Chanur to add @Spell)
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
8" Well, I actually even do not know much about m4. This explains why there
9" is probably very much missing here, yet !
Bram Moolenaar83caecf2015-01-14 19:42:21 +010010" But I missed good highlighting when editing my GNU autoconf/automake
Bram Moolenaar071d4272004-06-13 20:20:40 +000011" script, so I wrote this quick and dirty patch.
12
13
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020014" quit when a syntax file was already loaded
15if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000016 finish
17endif
18
19" define the config syntax
20syn match configdelimiter "[()\[\];,]"
21syn match configoperator "[=|&\*\+\<\>]"
Bram Moolenaar83caecf2015-01-14 19:42:21 +010022syn match configcomment "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000023syn match configfunction "\<[A-Z_][A-Z0-9_]*\>"
24syn match confignumber "[-+]\=\<\d\+\(\.\d*\)\=\>"
Bram Moolenaar83caecf2015-01-14 19:42:21 +010025syn keyword configDnl dnl contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000026syn keyword configkeyword if then else fi test for in do done
27syn keyword configspecial cat rm eval
Bram Moolenaar83caecf2015-01-14 19:42:21 +010028
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
Bram Moolenaar071d4272004-06-13 20:20:40 +000035
36" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020037" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000038
Bram Moolenaarf37506f2016-08-31 22:22:10 +020039hi 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000048
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
50let b:current_syntax = "config"
51
52" vim: ts=4