Add glog keybindings
This commit is contained in:
1
.config/vim/pack/plugins/opt/vim-polyglot
Submodule
1
.config/vim/pack/plugins/opt/vim-polyglot
Submodule
Submodule .config/vim/pack/plugins/opt/vim-polyglot added at 7972e8eea1
@@ -335,6 +335,11 @@ glog() {
|
||||
|
||||
local date="--date=format:%F %T"
|
||||
local colors="--color=always"
|
||||
local binds=(
|
||||
"ctrl-space:toggle-preview"
|
||||
"ctrl-j:preview-down"
|
||||
"ctrl-k:preview-up"
|
||||
)
|
||||
|
||||
# Display a colorful ascii graph of the commits in the above format and pipe
|
||||
# that into fzf.
|
||||
@@ -346,7 +351,7 @@ glog() {
|
||||
# on the commit hash.
|
||||
commit="$(\
|
||||
git log --pretty="$format" --graph "$date" $colors\
|
||||
| fzf --ansi --reverse --preview="
|
||||
| fzf --ansi --reverse --bind "${(j:,:)binds}" --preview="
|
||||
out=\"\$(echo {} | sed -Ee \"$ansi_escape\" -e \"$commit_hash\")\"
|
||||
if [ \"\$out\" ]; then
|
||||
git show --pretty=fuller \"${date} %z\" $colors \"\$out\"
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -46,3 +46,6 @@
|
||||
[submodule ".config/zsh/plugins/zsh-syntax-highlighting"]
|
||||
path = .config/zsh/plugins/zsh-syntax-highlighting
|
||||
url = https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||
[submodule ".config/vim/pack/plugins/opt/vim-polyglot"]
|
||||
path = .config/vim/pack/plugins/opt/vim-polyglot
|
||||
url = https://github.com/sheerun/vim-polyglot
|
||||
|
||||
Reference in New Issue
Block a user