Mercurial > vim
annotate runtime/syntax/m4.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | b6632d553df3 |
children | 46763b01cd9a |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: M4 | |
632 | 3 " Maintainer: Claudio Fleiner (claudio@fleiner.com) |
7 | 4 " URL: http://www.fleiner.com/vim/syntax/m4.vim |
632 | 5 " Last Change: 2005 Jan 15 |
7 | 6 |
7 " This file will highlight user function calls if they use only | |
8 " capital letters and have at least one argument (i.e. the '(' | |
9 " must be there). Let me know if this is a problem. | |
10 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
11 " quit when a syntax file was already loaded |
7 | 12 if !exists("main_syntax") |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
13 if exists("b:current_syntax") |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
14 finish |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
15 endif |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
16 " we define it here so that included files can test for it |
7 | 17 let main_syntax='m4' |
18 endif | |
19 | |
20 " define the m4 syntax | |
21 syn match m4Variable contained "\$\d\+" | |
22 syn match m4Special contained "$[@*#]" | |
632 | 23 syn match m4Comment "\<\(m4_\)\=dnl\>.*" contains=SpellErrors |
24 syn match m4Constants "\<\(m4_\)\=__file__" | |
25 syn match m4Constants "\<\(m4_\)\=__line__" | |
7 | 26 syn keyword m4Constants divnum sysval m4_divnum m4_sysval |
27 syn region m4Paren matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top | |
28 syn region m4Command matchgroup=m4Function start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top | |
29 syn region m4Command matchgroup=m4Preproc start="\<\(m4_\)\=\(include\|sinclude\)("he=e-1 end=")" contains=@m4Top | |
30 syn region m4Command matchgroup=m4Statement start="\<\(m4_\)\=\(syscmd\|esyscmd\|ifdef\|ifelse\|indir\|builtin\|shift\|errprint\|m4exit\|changecom\|changequote\|changeword\|m4wrap\|debugfile\|divert\|undivert\)("he=e-1 end=")" contains=@m4Top | |
31 syn region m4Command matchgroup=m4builtin start="\<\(m4_\)\=\(len\|index\|regexp\|substr\|translit\|patsubst\|format\|incr\|decr\|eval\|maketemp\)("he=e-1 end=")" contains=@m4Top | |
32 syn keyword m4Statement divert undivert | |
33 syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top | |
34 syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top | |
35 syn region m4String start="`" end="'" contained contains=@m4Top,@m4StringContents,SpellErrors | |
36 syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function | |
37 | |
38 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
39 " Only when an item doesn't have highlighting yet |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
40 command -nargs=+ HiLink hi def link <args> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
41 HiLink m4Delimiter Delimiter |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
42 HiLink m4Comment Comment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
43 HiLink m4Function Function |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
44 HiLink m4Keyword Keyword |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
45 HiLink m4Special Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
46 HiLink m4String String |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
47 HiLink m4Statement Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
48 HiLink m4Preproc PreProc |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
49 HiLink m4Type Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
50 HiLink m4Special Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
51 HiLink m4Variable Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
52 HiLink m4Constants Constant |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
53 HiLink m4Builtin Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
54 delcommand HiLink |
7 | 55 |
56 let b:current_syntax = "m4" | |
57 | |
58 if main_syntax == 'm4' | |
59 unlet main_syntax | |
60 endif | |
61 | |
62 " vim: ts=4 |