junegunn / junegunn/fzf-git.sh

Tmux config example

Open
#62 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.2k
Forks
97
PR merge metrics
No merged PRs in 30d

Description

```
set-environment -g FZF_GIT_SCRIPT "$HOME/.config/tmux/scripts/fzf-git.sh"
unbind-key b
bind-key -n M-b run-shell -b "\
bash -c \"cd \"#{pane_current_path}\"; $FZF_GIT_SCRIPT --list branches\" | \
fzf --tmux 80%,70% \
--ansi \
--border-label '🌲 Branches ' \
--header-lines 2 \
--tiebreak begin \
--preview-window down,border-top,40% \
--color hl:underline,hl+:underline \
--no-hscroll \
--bind 'ctrl-/:change-preview-window(down,70%|hidden|)' \
--bind 'ctrl-o:execute-silent:bash $FZF_GIT_SCRIPT --list branch {}' \
--bind 'alt-a:change-border-label(🌳 All branches)+reload:bash $FZF_GIT_SCRIPT --list all-branchesr' \
--preview \"git -C #{pane_current_path} log --oneline \
--graph --date=short --color=always --pretty='format:%C(auto)%cd %h%d %s' \
\\$(sed s/^..// <<< {} | cut -d' ' -f1) --\" \"$@\" | \
sed 's/^..//' | cut -d' ' -f1 | xargs -I % git -C #{pane_current_path} checkout % \
> /dev/null || true \
"
```

Press option+b and be happy! Took me some time, I link the project and I think this might help someone else looking for this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.