X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=sidebyside;f=.vim%2Fsyntax%2Fperforce.vim;fp=.vim%2Fsyntax%2Fperforce.vim;h=ab3efa70c3fbf49aa8fbf88064dcdd69b08cdef9;hb=d0d885039e0b7f2242d6db6eb2ba36da132f1b94;hp=0000000000000000000000000000000000000000;hpb=85808cfafda2e74a99654d9a940291563b13cd85;p=profile.git diff --git a/.vim/syntax/perforce.vim b/.vim/syntax/perforce.vim new file mode 100755 index 0000000..ab3efa7 --- /dev/null +++ b/.vim/syntax/perforce.vim @@ -0,0 +1,184 @@ +" Vim syntax file +" Language: Perforce SCM Spec +" Author: Hari Krishna Dara (hari_vim at yahoo dot com) +" Last Modified: 31-Mar-2004 @ 23:32 +" Plugin Version: 2.1 +" Revision: 1.0.4 +" Since Version: 1.4 +" +" 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 annotate branch branches change +syn keyword perforceCommands contained changes client clients counter counters +syn keyword perforceCommands contained delete depot dirs edit filelog files fix +syn keyword perforceCommands contained fixes help info integrate integrated job +syn keyword perforceCommands contained labelsync lock logger monitor 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'