diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 08:50:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 08:50:31 +0000 |
commit | aed8ce9da277f5ecffe968b324f242c41c3b752a (patch) | |
tree | d2e538394cb7a8a7c42a4aac6ccf1a8e3256999b /runtime/syntax/gitrebase.vim | |
parent | Initial commit. (diff) | |
download | vim-upstream.tar.xz vim-upstream.zip |
Adding upstream version 2:9.0.1378.upstream/2%9.0.1378upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/gitrebase.vim')
-rw-r--r-- | runtime/syntax/gitrebase.vim | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/runtime/syntax/gitrebase.vim b/runtime/syntax/gitrebase.vim new file mode 100644 index 0000000..13f157b --- /dev/null +++ b/runtime/syntax/gitrebase.vim @@ -0,0 +1,62 @@ +" Vim syntax file +" Language: git rebase --interactive +" Maintainer: Tim Pope <vimNOSPAM@tpope.org> +" Filenames: git-rebase-todo +" Last Change: 2022 Jan 05 + +if exists("b:current_syntax") + finish +endif + +syn case match + +let s:c = escape((matchstr(getline('$'), '^[#;@!$%^&|:]\S\@!') . '#')[0], '^$.*[]~\"/') + +syn match gitrebaseHash "\v<\x{7,}>" contained contains=@NoSpell +syn match gitrebaseCommit "\v<\x{7,}>" nextgroup=gitrebaseSummary skipwhite contains=@NoSpell +syn match gitrebasePick "\v^p%(ick)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseReword "\v^r%(eword)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite +syn match gitrebaseBreak "\v^b%(reak)=>" +syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseNoop "\v^noop>" +syn match gitrebaseMerge "\v^m(erge)=>" nextgroup=gitrebaseMergeOption,gitrebaseName skipwhite +syn match gitrebaseLabel "\v^l(abel)=>" nextgroup=gitrebaseName skipwhite +syn match gitrebaseReset "\v^(t|reset)=>" nextgroup=gitrebaseName skipwhite +syn match gitrebaseSummary ".*" contains=gitrebaseHash contained +syn match gitrebaseCommand ".*" contained +exe 'syn match gitrebaseComment " \@<=' . s:c . ' empty$" containedin=gitrebaseSummary contained' +exe 'syn match gitrebaseComment "^\s*' . s:c . '.*" contains=gitrebaseHash' +syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite +syn match gitrebaseMergeOption "\v-[Cc]>" nextgroup=gitrebaseMergeCommit skipwhite contained +syn match gitrebaseMergeCommit "\v<\x{7,}>" nextgroup=gitrebaseName skipwhite contained +syn match gitrebaseName "\v[^[:space:].*?i:^~/-]\S+" nextgroup=gitrebaseMergeComment skipwhite contained +exe 'syn match gitrebaseMergeComment "' . s:c . '" nextgroup=gitrebaseSummary skipwhite contained' + +unlet s:c + +hi def link gitrebaseCommit gitrebaseHash +hi def link gitrebaseHash Identifier +hi def link gitrebasePick Type +hi def link gitrebaseReword Conditional +hi def link gitrebaseEdit PreProc +hi def link gitrebaseSquash Statement +hi def link gitrebaseFixup Repeat +hi def link gitrebaseExec Operator +hi def link gitrebaseBreak Macro +hi def link gitrebaseDrop Comment +hi def link gitrebaseNoop Comment +hi def link gitrebaseMerge Exception +hi def link gitrebaseLabel Label +hi def link gitrebaseReset Keyword +hi def link gitrebaseSummary String +hi def link gitrebaseComment Comment +hi def link gitrebaseSquashError Error +hi def link gitrebaseMergeCommit gitrebaseCommit +hi def link gitrebaseMergeComment gitrebaseComment +hi def link gitrebaseName Tag + +let b:current_syntax = "gitrebase" |