Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
make.vim196 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:	Makefile3" Maintainer:	This runtime file is looking for a new maintainer.4" Previous Maintainer:	Claudio Fleiner <claudio@fleiner.com>, Roland Hieber <https://github.com/rohieb>5" URL:		https://github.com/vim/vim/blob/master/runtime/syntax/make.vim6" Last Change:	2022 Nov 067" 2025 Apr 15 by Vim project: rework Make flavor detection (#17089)8" 2025 Oct 12 by Vim project: update makeDefine highlighting (#18403)9" 2025 Oct 25 by Vim project: update makeTargetinDefine highlighting (#18570)10" 2025 Dec 23 by Vim project: fix too greedy match (#18938)11" 2025 Dec 23 by Vim project: wrong highlight with paranthesis inside quotes (#18818)12 13" quit when a syntax file was already loaded14if exists("b:current_syntax")15  finish16endif17 18let s:cpo_save = &cpo19set cpo&vim20 21" enable GNU extension when b:make_flavor is not set—detection failed or Makefile is POSIX-compliant22let s:make_flavor = 'gnu'23 24" some special characters25syn match makeSpecial	"^\s*[@+-]\+"26syn match makeNextLine	"\\\n\s*"27 28" catch unmatched define/endef keywords.  endef only matches it is by itself on a line, possibly followed by a commend29syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$"30	\ contains=makeStatement,makeIdent,makePreCondit,makeDefine,makeComment,makeTargetinDefine31 32if get(b:, 'make_flavor', s:make_flavor) == 'microsoft'33  " Microsoft Makefile specials34  syn case ignore35  syn match makeInclude	"^!\s*include\s.*$"36  syn match makePreCondit "^!\s*\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|else\s*if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"37  syn case match38endif39 40" identifiers; treat $$X like $X inside makeDefine41syn match makeIdent	"\$\$\w*"42syn match makeIdent	"\$\$\$\$\w*" containedin=makeDefine43syn match makeIdent	"\$[^({]"44syn match makeIdent	"\$\$[^({]" containedin=makeDefine45if get(b:, 'make_flavor', s:make_flavor) == 'microsoft'46  syn region makeIdent	start="\$(" end=")" contains=makeStatement,makeIdent,makeDString,makeSString47  syn region makeIdent	start="\${" end="}" contains=makeStatement,makeIdent,makeDString,makeSString48  syn region makeIdent	start="\$\$(" end=")" containedin=makeDefine contains=makeStatement,makeIdent,makeDString,makeSString49  syn region makeIdent	start="\$\${" end="}" containedin=makeDefine contains=makeStatement,makeIdent,makeDString,makeSString50else51  syn region makeIdent	start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeDString,makeSString52  syn region makeIdent	start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeDString,makeSString53  syn region makeIdent	start="\$\$(" skip="\\)\|\\\\" end=")" containedin=makeDefine contains=makeStatement,makeIdent,makeDString,makeSString54  syn region makeIdent	start="\$\${" skip="\\}\|\\\\" end="}" containedin=makeDefine contains=makeStatement,makeIdent,makeDString,makeSString55endif56syn match makeIdent	"^ *[^:#= \t]*\s*[:+?!*]="me=e-257syn match makeIdent	"^ *[^:#= \t]*\s*::="me=e-358syn match makeIdent	"^ *[^:#= \t]*\s*="me=e-159syn match makeIdent	"%"60 61" Makefile.in variables62syn match makeConfig "@[A-Za-z0-9_]\+@"63 64" make targets65syn match makeImplicit		"^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-166syn match makeImplicit		"^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-267 68syn region makeTargetinDefine transparent matchgroup=makeTargetinDefine69	\ start="^[~A-Za-z0-9_./$(){}%-][A-Za-z0-9_./\t ${}()%-]*&\?:\?:\{1,2}[^:=]"rs=e-170	\ end="[^\\]$"71	\ keepend72syn match makeTargetinDefine           "^[~A-Za-z0-9_./$(){}%*@-][A-Za-z0-9_./\t $(){}%*@-]*&\?::\=\s*$"73	\ contains=makeIdent,makeSpecTarget,makeComment74 75syn region makeTarget transparent matchgroup=makeTarget76	\ start="^[~A-Za-z0-9_./$(){}%-][A-Za-z0-9_./\t ${}()%-]*&\?:\?:\{1,2}[^:=]"rs=e-177	\ end="[^\\]$"78	\ keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment,makeDString79	\ skipnl nextGroup=makeCommands80syn match makeTarget           "^[~A-Za-z0-9_./$(){}%*@-][A-Za-z0-9_./\t $(){}%*@-]*&\?::\=\s*$"81	\ contains=makeIdent,makeSpecTarget,makeComment82	\ skipnl nextgroup=makeCommands,makeCommandError83 84syn region makeSpecTarget	transparent matchgroup=makeSpecTarget85	\ start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|NOTPARALLEL\|POSIX\)\>\s*:\{1,2}[^:=]"rs=e-186	\ end="[^\\]$" keepend87	\ contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands88syn match makeSpecTarget	"^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|NOTPARALLEL\|POSIX\)\>\s*::\=\s*$"89	\ contains=makeIdent,makeComment90	\ skipnl nextgroup=makeCommands,makeCommandError91 92if get(b:, 'make_flavor', s:make_flavor) == 'bsd'93  syn region makeSpecTarget	transparent matchgroup=makeSpecTarget94	\ start="^\.DELETE_ON_ERROR\>\s*:\{1,2}[^:=]"rs=e-195	\ end="[^\\]$" keepend96	\ contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands97  syn match makeSpecTarget	"^\.DELETE_ON_ERROR\>\s*::\=\s*$"98	\ contains=makeIdent,makeComment99	\ skipnl nextgroup=makeCommands,makeCommandError100elseif get(b:, 'make_flavor', s:make_flavor) == 'gnu'101  syn region makeSpecTarget	transparent matchgroup=makeSpecTarget102	\ start="^\.\(EXPORT_ALL_VARIABLES\|DELETE_ON_ERROR\|INTERMEDIATE\|KEEP_STATE\|LIBPATTERNS\|ONESHELL\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1103	\ end="[^\\]$" keepend104	\ contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands105  syn match makeSpecTarget	"^\.\(EXPORT_ALL_VARIABLES\|DELETE_ON_ERROR\|INTERMEDIATE\|KEEP_STATE\|LIBPATTERNS\|ONESHELL\|SECONDARY\)\>\s*::\=\s*$"106	\ contains=makeIdent,makeComment107	\ skipnl nextgroup=makeCommands,makeCommandError108endif109 110syn match makeCommandError "^\s\+\S.*" contained111syn region makeCommands contained start=";"hs=s+1 start="^\t"112	\ end="^[^\t#]"me=e-1,re=e-1 end="^$"113	\ contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString114	\ nextgroup=makeCommandError115syn match makeCmdNextLine	"\\\n."he=e-1 contained116 117" some directives118syn match makeInclude	"^ *[-s]\=include\s.*$"119syn match makeExport    "^ *\(export\|unexport\)\>"120if get(b:, 'make_flavor', s:make_flavor) == 'gnu'121  " Statements / Functions (GNU make)122  syn match makePreCondit	"^ *\(ifn\=\(eq\|def\)\>\|else\(\s\+ifn\=\(eq\|def\)\)\=\>\|endif\>\)"123  syn match makeStatement	"^ *vpath\>"124  syn match makeOverride	"^ *override\>"125  syn match makeStatement contained "[({]\(abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|file\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|guile\|if\|info\|intcmp\|join\|lastword\|let\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|subst\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1126endif127 128" Comment129if !exists("make_no_comments")130  if get(b:, 'make_flavor', s:make_flavor) == 'microsoft'131    syn match   makeComment	"#.*" contains=@Spell,makeTodo132  else133    syn region  makeComment	start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo134    syn match   makeComment	"#$" contains=@Spell135  endif136endif137syn keyword makeTodo TODO FIXME XXX contained138 139" match escaped quotes and any other escaped character140" except for $, as a backslash in front of a $ does141" not make it a standard character, but instead it will142" still act as the beginning of a variable143" The escaped char is not highlightet currently144syn match makeEscapedChar	"\\[^$]"145 146 147syn region  makeDString start=+\(\\\)\@<!"+  skip=+\\.+  end=+"+  contained contains=makeIdent148syn region  makeSString start=+\(\\\)\@<!'+  skip=+\\.+  end=+'+  contained contains=makeIdent149syn region  makeBString start=+\(\\\)\@<!`+  skip=+\\.+  end=+`+  contains=makeIdent,makeSString,makeDString,makeNextLine150 151" Syncing152syn sync minlines=20 maxlines=200153 154" Sync on Make command block region: When searching backwards hits a line that155" can't be a command or a comment, use makeCommands if it looks like a target,156" NONE otherwise.157syn sync match makeCommandSync groupthere NONE "^[^\t#]"158syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"159syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}\s*$"160 161" Define the default highlighting.162" Only when an item doesn't have highlighting yet163 164hi def link makeNextLine	makeSpecial165hi def link makeCmdNextLine	makeSpecial166hi link     makeOverride        makeStatement167hi link     makeExport          makeStatement168 169hi def link makeSpecTarget	Statement170if !exists("make_no_commands")171hi def link makeCommands	Number172endif173hi def link makeImplicit	Function174hi def link makeTarget		Function175hi def link makeTargetinDefine		Function176hi def link makeInclude		Include177hi def link makePreCondit	PreCondit178hi def link makeStatement	Statement179hi def link makeIdent		Identifier180hi def link makeSpecial		Special181hi def link makeComment		Comment182hi def link makeDString		String183hi def link makeSString		String184hi def link makeBString		Function185hi def link makeError		Error186hi def link makeTodo		Todo187hi def link makeDefine		Define188hi def link makeCommandError	Error189hi def link makeConfig		PreCondit190 191let b:current_syntax = "make"192 193let &cpo = s:cpo_save194unlet s:cpo_save195" vim: ts=8196 
codekingpro/portable-devtools · Team Ai