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