" Vim syntax file " Language: Justfile " Maintainer: Peter Benjamin <@pbnj> " Last Change: 2025 Jan 25 " Credits: The original author, Noah Bogart if exists('b:current_syntax') finish endif let s:cpo_save = &cpo set cpo&vim let b:current_syntax = 'just' " syncing fromstart prevents mismatched highlighting when jumping around in a justfile " linebreaks= keeps multi-line constructs highlighted correctly while typing syn sync fromstart linebreaks=10 " a-zA-Z0-9_- syn iskeyword @,48-57,_,- syn match justComment "#.*$" contains=@Spell,justCommentTodo syn match justCommentInBody '#.*$' contained contains=justCommentTodo,justInterpolation,@justOtherCurlyBraces syn keyword justCommentTodo TODO FIXME XXX contained syn match justShebang "^\s*#!.*$" contains=justInterpolation,@justOtherCurlyBraces syn match justName "\h\k*" contained syn match justFunction "\h\k*" contained syn match justPreBodyComment "\v%(\s|\\\n)*%([^\\]\n)@3%(%(\s|\\\n)*\=)@!" contained syn region justRecipeParenDefault \ matchgroup=justRecipeDepParamsParen start='\v%(\=%(\s|\\\n)*)@<=\(' end='\V)' \ contained \ contains=@justExpr syn match justRecipeSubsequentDeps '\V&&' contained syn match justRecipeNoDeps '\v:%(\s|\\\n)*\n|:#@=|:%(\s|\\\n)+#@=' \ transparent contained \ contains=justRecipeColon \ nextgroup=justPreBodyComment,@justBodies syn region justRecipeDeps start="\v:%(\s|\\\n)*%([a-zA-Z_(]|\&\&)" skip='\\\n' end="\v#@=|\\@1