-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
Could you support syntax highlighting for git range-diff output?
It's useful in rebasing...
Sample output of the command is below:
% git range-diff base..tmp base..master
1: b92fe39 = 1: b92fe39 a
2: 4a49bd2 = 2: 4a49bd2 b
3: cd2481d = 3: cd2481d c
4: b8f778d ! 4: b804dd4 e
@@ Metadata
Author: xxxxxxxx <xxxxxxxx@example.com>
## Commit message ##
- e
+ e~
## test.txt ##
@@
a
b
c
-+e
+e
c
b
% git log --graph --all -p
* commit b804dd468388efe6d08c2f4230c5cd3ceda3f00c (HEAD -> master)
| Author: xxxxxxxx <xxxxxxxx@example.com>
| Date: xxx xxx xx xx:xx:xx xxxx +xxxx
|
| e~
|
| diff --git a/test.txt b/test.txt
| index 2d4ca2c..3a3e0e5 100644
| --- a/test.txt
| +++ b/test.txt
| @@ -1,6 +1,7 @@
| a
| b
| c
| +e
| c
| b
| a
|
| * commit b8f778db7a4794d4fe429a2adc77442990087dad (tmp)
|/ Author: xxxxxxxx <xxxxxxxx@example.com>
| Date: xxx xxx xx xx:xx:xx xxxx +xxxx
|
| e
|
| diff --git a/test.txt b/test.txt
| index 2d4ca2c..2f04e0a 100644
| --- a/test.txt
| +++ b/test.txt
| @@ -1,6 +1,8 @@
| a
| b
| c
| +e
| +e
| c
| b
| a
|
* commit cd2481dd1d9e9ad0dcd649cdd48d61de9c1d1810
| Author: xxxxxxxx <xxxxxxxx@example.com>
| Date: xxx xxx xx xx:xx:xx xxxx +xxxx
|
| c
|
| diff --git a/test.txt b/test.txt
| index f7a2241..2d4ca2c 100644
| --- a/test.txt
| +++ b/test.txt
| @@ -1,4 +1,6 @@
| a
| b
| +c
| +c
| b
| a
|
* commit 4a49bd20b6bedcaa74d4b3121a578f48baaba1d7
| Author: xxxxxxxx <xxxxxxxx@example.com>
| Date: xxx xxx xx xx:xx:xx xxxx +xxxx
|
| b
|
| diff --git a/test.txt b/test.txt
| index 7e8a165..f7a2241 100644
| --- a/test.txt
| +++ b/test.txt
| @@ -1,2 +1,4 @@
| a
| +b
| +b
| a
|
* commit b92fe39785c92aa52a471f822ff77e9302314279
| Author: xxxxxxxx <xxxxxxxx@example.com>
| Date: xxx xxx xx xx:xx:xx xxxx +xxxx
|
| a
|
| diff --git a/test.txt b/test.txt
| new file mode 100644
| index 0000000..7e8a165
| --- /dev/null
| +++ b/test.txt
| @@ -0,0 +1,2 @@
| +a
| +a
|
* commit b8fbc899b2aa83bba97dccaf2b4dc1a89dffef19 (base)
Author: xxxxxxxx <xxxxxxxx@example.com>
Date: xxx xxx xx xx:xx:xx xxxx +xxxx
Initial commit
Now I sets some :match highlighting by self as below.
I was wondering if such highlighting was supported natively...
let g:match_rangeDiff = []
let g:match_rangeDiff += [ { 'group' : 'DiffAdd' , 'pattern' : '^ \zs+.*' , 'priority' : 10 , 'id' : 100 } ]
let g:match_rangeDiff += [ { 'group' : 'DiffDelete' , 'pattern' : '^ \zs-.*' , 'priority' : 10 , 'id' : 101 } ]
let g:match_rangeDiff += [ { 'group' : 'diffAdded' , 'pattern' : '^ [ +-]\zs+.*' , 'priority' : 10 , 'id' : 102 } ]
let g:match_rangeDiff += [ { 'group' : 'diffRemoved' , 'pattern' : '^ [ +-]\zs-.*' , 'priority' : 10 , 'id' : 103 } ]
call setmatches(g:match_rangeDiff)Metadata
Metadata
Assignees
Labels
No labels
