blob: 3636ed41307689511b9c1ea75eb44776b77ba7d8 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: configure.in script: M4 with sh
Bram Moolenaar72540672018-02-09 22:00:53 +01003" Former Maintainer: Christian Hammesr <ch@lathspell.westend.com>
4" Last Change: 2018 Feb 03
Bram Moolenaar83caecf2015-01-14 19:42:21 +01005" (patch from Yngve Inntjore Levinsen to detect AC_MSG)
6" (patch from Khym Chanur to add @Spell)
Bram Moolenaar72540672018-02-09 22:00:53 +01007" (patch from James McCoy to fix paren matching)
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
9" Well, I actually even do not know much about m4. This explains why there
10" is probably very much missing here, yet !
Bram Moolenaar83caecf2015-01-14 19:42:21 +010011" But I missed good highlighting when editing my GNU autoconf/automake
Bram Moolenaar071d4272004-06-13 20:20:40 +000012" script, so I wrote this quick and dirty patch.
13
14
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020015" quit when a syntax file was already loaded
16if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000017 finish
18endif
19
20" define the config syntax
21syn match configdelimiter "[()\[\];,]"
22syn match configoperator "[=|&\*\+\<\>]"
Bram Moolenaar83caecf2015-01-14 19:42:21 +010023syn match configcomment "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000024syn match configfunction "\<[A-Z_][A-Z0-9_]*\>"
25syn match confignumber "[-+]\=\<\d\+\(\.\d*\)\=\>"
Bram Moolenaar83caecf2015-01-14 19:42:21 +010026syn keyword configDnl dnl contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000027syn keyword configkeyword if then else fi test for in do done
28syn keyword configspecial cat rm eval
Bram Moolenaar83caecf2015-01-14 19:42:21 +010029
30" This shortens the script, see syn-ext-match..
31syn region configstring start=+\z(["'`]\)+ skip=+\\\z1+ end=+\z1+ contains=@Spell
32
33" Anything inside AC_MSG_TYPE([...]) and AC_MSG_TYPE(...) is a string.
Bram Moolenaar72540672018-02-09 22:00:53 +010034syn region configmsg matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" matchgroup=configdelimiter end="\])" contains=configdelimiter,@Spell
35syn region configmsg matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000036
37" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020038" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000039
Bram Moolenaarf37506f2016-08-31 22:22:10 +020040hi def link configdelimiter Delimiter
41hi def link configoperator Operator
42hi def link configcomment Comment
43hi def link configDnl Comment
44hi def link configfunction Function
45hi def link confignumber Number
46hi def link configkeyword Keyword
47hi def link configspecial Special
48hi def link configstring String
Bram Moolenaar72540672018-02-09 22:00:53 +010049hi def link configmsg String
Bram Moolenaar071d4272004-06-13 20:20:40 +000050
Bram Moolenaar071d4272004-06-13 20:20:40 +000051
52let b:current_syntax = "config"
53
54" vim: ts=4