File: make.vim

package info (click to toggle)
vim-rt 5.3-12
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,172 kB
  • ctags: 815
  • sloc: makefile: 857; awk: 778; ansic: 379; perl: 192; sh: 167
file content (102 lines) | stat: -rw-r--r-- 3,668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
" Vim syntax file
" Language:	Makefile
" Maintainer:	Claudio Fleiner <claudio@fleiner.com>
" URL:		http://www.fleiner.com/vim/syntax/make.vim
" Last change:	1998 Jul 22

" Remove any old syntax stuff hanging around
syn clear

" This file makes use of the highlighting "Function", which is not defined
" in the normal syntax.vim file yet.


" some directives
syn match makePreCondit	"^\s*\(ifeq\>\|else\>\|endif\>\|define\>\|ifneq\>\|ifdef\>\|ifndef\)"
syn match makeInclude	"^\s*include"
syn match makeStatement	"^\s*vpath"
syn match makeOverride	"^\s*override"
hi link makeOverride makeStatement


" make targets
syn match makeSpecTarget	"^\.SUFFIXES"
syn match makeSpecTarget	"^\.PHONY"
syn match makeSpecTarget	"^\.DEFAULT"
syn match makeSpecTarget	"^\.PRECIOUS"
syn match makeSpecTarget	"^\.IGNORE"
syn match makeSpecTarget	"^\.SILENT"
syn match makeSpecTarget	"^\.EXPORT_ALL_VARIABLES"
syn match makeSpecTarget	"^\.KEEP_STATE"
syn match makeImplicit	        "^\.\w*\.\w*\s*:[^=]"me=e-2
syn match makeImplicit	        "^\.\w*\.\w*\s*:$"me=e-1
syn match makeTarget		"^\w[A-Za-z0-9_./\t ]*:[^=]"me=e-2
syn match makeTarget		"^\w[A-Za-z0-9_./\t ]*:$"me=e-1

" Statements / Functions (GNU make)
syn match makeStatement contained "(subst"ms=s+1
syn match makeStatement contained "(addprefix"ms=s+1
syn match makeStatement contained "(addsuffix"ms=s+1
syn match makeStatement contained "(basename"ms=s+1
syn match makeStatement contained "(dir"ms=s+1
syn match makeStatement contained "(filter"ms=s+1
syn match makeStatement contained "(filter-out"ms=s+1
syn match makeStatement contained "(findstring"ms=s+1
syn match makeStatement contained "(firstword"ms=s+1
syn match makeStatement contained "(foreach"ms=s+1
syn match makeStatement contained "(join"ms=s+1
syn match makeStatement contained "(notdir"ms=s+1
syn match makeStatement contained "(origin"ms=s+1
syn match makeStatement contained "(patsubst"ms=s+1
syn match makeStatement contained "(shell"ms=s+1
syn match makeStatement contained "(sort"ms=s+1
syn match makeStatement contained "(strip"ms=s+1
syn match makeStatement contained "(suffix"ms=s+1
syn match makeStatement contained "(wildcard"ms=s+1
syn match makeStatement contained "(word"ms=s+1
syn match makeStatement contained "(words"ms=s+1

" some special characters
syn match makeSpecial	"^\s*[@-][@-]*"
syn match makeNextLine	"\\$"

" identifiers
syn match makeIdent		"\$([^)]*)" contains=makeStatement
syn match makeIdent		"\$\$[A-Za-z0-9_]*"
syn match makeIdent		"\$[^({]"
syn match makeIdent		"\${[^}]*}"
syn match makeIdent		"[A-Za-z][A-Za-z0-9_]*[ \t]*[:+?!]="me=e-2
syn match makeIdent		"[A-Za-z][A-Za-z0-9_]*[ \t]*="me=e-1
syn match makeIdent		"%"

" Comment
syn match  makeComment	"#.*$"

" match escaped quotes, $ and any other escaped character
" The escaped char is not highlightet currently
syn match makeEscapedChar	"\\."

syn region  makeDString      start=+"+  skip=+\\"+  end=+"+  contains=makeIdent
syn region  makeSString      start=+'+  skip=+\\'+  end=+'+  contains=makeIdent
syn region  makeBString      start=+`+  skip=+\\`+  end=+`+  contains=makeIdent,makeSString,makeDString,makeNextLine

if !exists("did_makefile_syntax_inits")
  let did_makefile_syntax_inits = 1
  hi link makeNextLine	makeSpecial
  hi link makeSpecTarget	Statement
  hi link makeImplicit	Function
  hi link makeTarget	Function
  hi link makeInclude	Include
  hi link makePreCondit	PreCondit
  hi link makeStatement	Statement
  hi link makeIdent	Identifier
  hi link makeSpecial	Special
  hi link makeComment	Comment
  hi link makeDString	String
  hi link makeSString	String
  hi link makeBString	Function
endif

let b:current_syntax = "make"

" vim: ts=8