" Vim syntax file " Language: Perforce SCM Spec " Author: Hari Krishna " Last Modified: 15-Jan-2003 @ 12:54 " Plugin Version: 1.4 " Revision: 1.0.3 " Since Version: 1.4 " " Usage: " Place this file in syntax director under one of the vim runtime " directories. This is automatically be used by the perforce plugin for " all the perforce windows. If you want to specifically enable perforce " syntax highlighting for any vim buffers, just run the command: " " set ft=perforce " " at command prompt. " You can also change the syntax coloring by inserting the following lines " in your .vimrc: " " hi link perforceSpecKey " hi link perforceComment " hi link perforceDate " hi link perforceCommands " hi link perforceHelpKeys " hi link perforceClientRoot " hi link perforceKeyName " hi link perforceDepotFile " hi link perforceLocalFile " hi link perforceVerSep " hi link perforceVersion " hi link perforceSubmitType " hi link perforceDefaultSubmitType " hi link perforceViewExclude " hi link perforceDepotView " hi link perforceClientView " " Replace the with whatever group name " you want, such as, Comment, Special etc. " " TODO: " Filelog definition can be more complete. " Don't know all the cases of resolve lines, so it may not be complete. " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif " Generic interactive command: " View region: syn region perforceView start="^View:$" end="\%$" contains=perforceSpec,perforceViewLine syn region perforceFiles start="^Files:$" end="\%$" contains=perforceSpec,perforceChangeFilesLine,perforceSubmitFilesLine " Exclude View and Files alone, so that they can be matched by the regions. syn match perforceSpecline "^.*\%(\]\+> ([^)]\+) .*$" contains=perforceUserName,perforceDate syn match perforceUserName "^\w\+\%( <\)\@=" contained " jobs syn match perforceJobItem "^\S\+ on \d\+/\d\+/\d\+ by .*$" contains=perforceJobName,perforceDate,perforceClientName syn match perforceJobName "^\S\+\%( on\)\@=" contained syn match perforceClientName "\%( by \)\@<=[^@[:space:]]\+ \@=" contained " fixes syn match perforceFixItem "^\S\+ fixed by change \d\+.*$" contains=perforceJobName,perforceChangeNumber,perforceDate,perforceUserAtClient syn match perforceJobName "^\S\+\%( fixed \)\@=" contained syn match perforceChangeNumber "\%(by change \)\@<=\d\+ \@=" contained " opened, files, have etc. " The format of have is different because it contains the local file. syn match perforceFilelistLine "^//[^/[:space:]]\+/.*#\d\+ - .*$" contains=perforceDepotFileSpec,perforceLocalFile " have syn match perforceFilelistLine "^//[^/[:space:]]\+/.*#\d\+ - \%(branch\|integrate\|edit\|delete\|add\).*$" contains=perforceDepotFileSpec,perforceSubmitType,perforceDefaultSubmitType,perforceChangeNumber " opened, files syn match perforceChangeNumber "\%( change \)\@<=\d\+ \@=" contained syn match perforceSubmitType "\%( - \)\@<=\S\+\%(\%( default\)\? change \)\@=" contained syn match perforceSubmitType "\%(# \)\@<=\S\+$" contained " change. syn match perforceDefaultSubmitType "\\@=" contained syn match perforceVerStr "#\d\+" contains=perforceVerSep,perforceVersion contained syn match perforceVerSep "#" contained syn match perforceVersion "\d\+" contained syn keyword perforceCommands contained add admin branch branches change changes syn keyword perforceCommands contained client clients counter counters delete syn keyword perforceCommands contained depot dirs edit filelog files fix fixes syn keyword perforceCommands contained help info integrate integrated job syn keyword perforceCommands contained labelsync lock logger obliterate syn keyword perforceCommands contained reopen resolve resolved revert review syn keyword perforceCommands contained triggers typemap unlock user users syn keyword perforceCommands contained verify where reviews set submit sync syn keyword perforceCommands contained opened passwd print protect rename syn keyword perforceCommands contained jobs jobspec label labels flush fstat syn keyword perforceCommands contained group groups have depots describe diff syn keyword perforceCommands contained diff2 hi link perforceLabelName perforceKeyName hi link perforceBranchName perforceKeyName hi link perforceDepotName perforceKeyName hi link perforceJobName perforceKeyName hi link perforceClientName perforceKeyName hi link perforceUserName perforceKeyName hi link perforceChangeNumber perforceKeyName hi link perforceResolveTargetFile perforceDepotFile hi def link perforceSpecKey Label hi def link perforceComment Comment hi def link perforceNumChunks Constant hi def link perforceConflicting Error hi def link perforceResolveSkipped Error hi def link perforceDate Constant hi def link perforceCommands Identifier hi def link perforceHelpKeys Identifier hi def link perforceClientRoot Identifier hi def link perforceKeyName Special hi def link perforceDepotFile Directory hi def link perforceLocalFile Identifier hi def link perforceVerSep Operator hi def link perforceVersion Constant hi def link perforceSubmitType Type hi def link perforceDefaultSubmitType WarningMsg hi def link perforceViewExclude WarningMsg hi def link perforceDepotView Directory hi def link perforceClientView Identifier let b:current_syntax='perforce'