Last active
March 27, 2021 05:09
-
-
Save podhmo/fdc261640fd044648e73e01c5d62b9cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## colorful word level highlight diff | |
# diff -u <> <> | cdiffhighlight | |
cdiffhighlight() { | |
SED=$(which gsed || which sed) | |
$SED 's/^- /\x1b[1;31m-/;s/^+ /\x1b[1;32m+/;s/^@/\x1b[1;36m@/;s/$/\x1b[0m/' | diff-highlight | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "foo", | |
"age": 20, | |
"type": "person" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "bar", | |
"age": 21, | |
"type": "person" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: | |
$(MAKE) -k diff cdiff | |
diff: | |
diff -u 000person.json 001person.json | |
cdiff: | |
. .bash_functions && diff -u 000person.json 001person.json | cdiffhighlight |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
# \x1b[31m
かもしれない。git diffの場合はboldが付いていない。