Browse Source

++git-cblame

master
Maxim Likhachev 5 years ago
parent
commit
6981c67821
  1. 1
      README.md
  2. 17
      git-cblame

1
README.md

@ -91,6 +91,7 @@ will create the symbolic link for each script in the \<path> directory.
### Git ### Git
- [git-aliases](git-aliases) shows a commented list of all git aliases. - [git-aliases](git-aliases) shows a commented list of all git aliases.
- [git-cblame](git-cblame) adds a syntax highlighting to the standard `git blame` command.
- [git-forks](git-forks) shows the latest forks of github repository. - [git-forks](git-forks) shows the latest forks of github repository.
- [git-graphviz](git-graphviz) creates dot-graph of a git repository. - [git-graphviz](git-graphviz) creates dot-graph of a git repository.
- [git-ignore](git-ignore) gets specified gitignore settings from [https://gitignore.io/](https://gitignore.io/) website. - [git-ignore](git-ignore) gets specified gitignore settings from [https://gitignore.io/](https://gitignore.io/) website.

17
git-cblame

@ -0,0 +1,17 @@
#!/bin/bash
# Blame с подсветкой синтаксиса
vcat() {
BAT_CONFIG_PATH="$SHELLRC/etc/soft/bat/bat.conf" bat --decorations never "$1"
}
clr() {
sed -e "s/$1/$(echo -e "\033")[7;32m&$(echo -e "\033")[1;0m/g"
}
paste -d ' ' \
<(git blame "$1" | cut -d ')' -f 1 | sed 's/(//' | clr "0\{9\}.*Not Committed Yet.*") \
<(vcat "$1") \
| less -R
Loading…
Cancel
Save