|
1 | 1 | if exists("b:current_syntax")
|
2 | 2 | finish
|
3 | 3 | endif
|
| 4 | + |
4 | 5 | " Support the rebase todo highlights
|
5 | 6 | source $VIMRUNTIME/syntax/gitrebase.vim
|
6 | 7 |
|
7 |
| -syn match NeogitObjectId /^[a-z0-9]\{7,}\>/ |
8 |
| -syn match NeogitCommitMessage /.*/ contained |
9 |
| -syn match NeogitBranch /\S\+/ contained nextgroup=NeogitCommitMessage |
10 |
| -syn match NeogitRemote /\S\+/ contained nextgroup=NeogitCommitMessage |
11 |
| -syn match NeogitDiffAdd /.*/ contained |
12 |
| -syn match NeogitDiffDelete /.*/ contained |
13 |
| -syn match NeogitStash /stash@{[0-9]*}\ze/ |
14 |
| -syn match NeogitUnmergedInto /Unmerged into/ contained |
15 |
| -syn match NeogitUnpulledFrom /Unpulled from/ contained |
| 8 | +syn match NeogitCommitMessage /.*/ contained |
| 9 | +syn match NeogitBranch /\S\+/ contained nextgroup=NeogitCommitMessage |
| 10 | +syn match NeogitRemote /\S\+/ contained nextgroup=NeogitCommitMessage |
| 11 | +syn match NeogitDiffAdd /.*/ contained |
| 12 | +syn match NeogitDiffDelete /.*/ contained |
| 13 | +syn match NeogitUnmergedInto /Unmerged into/ contained |
| 14 | +syn match NeogitUnpulledFrom /Unpulled from/ contained |
| 15 | +syn match NeogitStash /stash@{[0-9]*}\ze/ |
| 16 | +syn match NeogitObjectId /^[a-z0-9]\{7,}\>\s/ |
16 | 17 |
|
17 | 18 | let b:sections = ["Untracked files", "Unstaged changes", "Unmerged changes", "Unpulled changes", "Recent commits", "Staged changes", "Stashes", "Rebasing"]
|
18 | 19 |
|
19 | 20 | for section in b:sections
|
20 | 21 | let id = join(split(section, " "), "")
|
21 | 22 | execute 'syn match Neogit' . id . ' /^' . section . '/ contained'
|
22 | 23 | execute 'syn region Neogit' . id . 'Region start=/^' . section . '\ze.*/ end=/./ contains=Neogit' . id
|
23 |
| - execute 'hi def link Neogit' . id . ' Function' |
24 | 24 | endfor
|
25 | 25 |
|
26 |
| -syn region NeogitHeadRegion start=/^Head: \zs/ end=/$/ contains=NeogitBranch |
27 |
| -syn region NeogitPushRegion start=/^Push: \zs/ end=/$/ contains=NeogitRemote |
| 26 | +syn region NeogitHeadRegion start=/^Head: \zs/ end=/$/ contains=NeogitBranch |
| 27 | +syn region NeogitPushRegion start=/^Push: \zs/ end=/$/ contains=NeogitRemote |
28 | 28 | syn region NeogitUnmergedIntoRegion start=/^Unmerged into .*/ end=/$/ contains=NeogitRemote,NeogitUnmergedInto
|
29 | 29 | syn region NeogitUnpulledFromRegion start=/^Unpulled from .*/ end=/$/ contains=NeogitRemote,NeogitUnpulledFrom
|
30 |
| -syn region NeogitDiffAddRegion start=/^+.*$/ end=/$/ contains=NeogitDiffAdd |
31 |
| -syn region NeogitDiffDeleteRegion start=/^-.*$/ end=/$/ contains=NeogitDiffDelete |
32 |
| - |
33 |
| -hi def link NeogitBranch Macro |
34 |
| -hi def link NeogitRemote SpecialChar |
35 |
| -hi def link NeogitObjectId Comment |
36 |
| - |
37 |
| -hi def link NeogitDiffAdd DiffAdd |
38 |
| -hi def link NeogitDiffDelete DiffDelete |
39 |
| - |
40 |
| -hi def link NeogitUnmergedInto Function |
41 |
| -hi def link NeogitUnpulledFrom Function |
42 |
| - |
43 |
| -hi def link NeogitStash Comment |
44 |
| -hi def link NeogitRebaseDone Comment |
45 |
| - |
46 |
| -hi def NeogitFold guifg=None guibg=None |
47 |
| - |
48 |
| -sign define NeogitDiffContextHighlight linehl=NeogitDiffContextHighlight |
49 |
| -sign define NeogitRebaseDone linehl=NeogitRebaseDone |
50 |
| -sign define NeogitHunkHeader linehl=NeogitHunkHeader |
51 |
| -sign define NeogitHunkHeaderHighlight linehl=NeogitHunkHeaderHighlight |
52 |
| -sign define NeogitDiffAdd linehl=NeogitDiffAdd |
53 |
| -sign define NeogitDiffAddHighlight linehl=NeogitDiffAddHighlight |
54 |
| -sign define NeogitDiffDelete linehl=NeogitDiffDelete |
55 |
| -sign define NeogitDiffDeleteHighlight linehl=NeogitDiffDeleteHighlight |
56 |
| - |
57 |
| - |
58 |
| -"TODO: find a better way to do this |
| 30 | +syn region NeogitDiffAddRegion start=/^+.*$/ end=/$/ contains=NeogitDiffAdd |
| 31 | +syn region NeogitDiffDeleteRegion start=/^-.*$/ end=/$/ contains=NeogitDiffDelete |
0 commit comments