refactor(git): rework module around clearer Status and Repo split
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax match gitStatusLabel /\v^(Head|Push)\ze:/
|
||||
syntax match gitStatusBranch /\v(^(Head|Push):\s+)@<=\S+/
|
||||
syntax match gitStatusAhead /\v\+\d+/
|
||||
syntax match gitStatusBehind /\v-\d+/
|
||||
|
||||
syntax region gitStatusUntrackedHeader start=/\v^Untracked>/ end=/\v^$/
|
||||
syntax region gitStatusUnstagedHeader start=/\v^Unstaged>/ end=/\v^$/
|
||||
syntax region gitStatusStagedHeader start=/\v^Staged>/ end=/\v^$/
|
||||
syntax region gitStatusUnmergedHeader start=/\v^Unmerged>/ end=/\v^$/
|
||||
syntax region gitStatusUnpushedHeader start=/\v^Unpushed>/ end=/\v^$/
|
||||
syntax region gitStatusUnpulledHeader start=/\v^Unpulled>/ end=/\v^$/
|
||||
|
||||
syntax match gitStatusUntrackedLabel /\v^Untracked/ contained containedin=gitStatusUntrackedHeader
|
||||
syntax match gitStatusUnstagedLabel /\v^Unstaged/ contained containedin=gitStatusUnstagedHeader
|
||||
syntax match gitStatusStagedLabel /\v^Staged/ contained containedin=gitStatusStagedHeader
|
||||
syntax match gitStatusUnmergedLabel /\v^Unmerged/ contained containedin=gitStatusUnmergedHeader
|
||||
syntax match gitStatusUnpushedLabel /\v^Unpushed/ contained containedin=gitStatusUnpushedHeader
|
||||
syntax match gitStatusUnpulledLabel /\v^Unpulled/ contained containedin=gitStatusUnpulledHeader
|
||||
|
||||
syntax match gitStatusHeaderCount /\v\(\zs\d+\ze\)/ contained containedin=gitStatusUntrackedHeader,
|
||||
\ gitStatusUnstagedHeader,
|
||||
\ gitStatusStagedHeader,
|
||||
\ gitStatusUnmergedHeader,
|
||||
\ gitStatusUnpushedHeader,
|
||||
\ gitStatusUnpulledHeader
|
||||
|
||||
highlight default link gitStatusLabel Label
|
||||
highlight default link gitStatusBranch None
|
||||
highlight default link gitStatusAhead GitUnpushed
|
||||
highlight default link gitStatusBehind GitUnpulled
|
||||
highlight default link gitStatusHeaderCount Number
|
||||
|
||||
highlight default link gitStatusUntrackedLabel gitStatusLabel
|
||||
highlight default link gitStatusUnstagedLabel gitStatusLabel
|
||||
highlight default link gitStatusStagedLabel gitStatusLabel
|
||||
highlight default link gitStatusUnmergedLabel gitStatusLabel
|
||||
highlight default link gitStatusUnpushedLabel gitStatusLabel
|
||||
highlight default link gitStatusUnpulledLabel gitStatusLabel
|
||||
|
||||
let b:current_syntax = "gitStatus"
|
||||
Reference in New Issue
Block a user