Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tmux config example #62

Open
Nathan-ma opened this issue Jan 13, 2025 · 0 comments
Open

Tmux config example #62

Nathan-ma opened this issue Jan 13, 2025 · 0 comments

Comments

@Nathan-ma
Copy link

Nathan-ma commented Jan 13, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant