bind-key o display-menu \
find o "display-popup -E -w 100% \"~/bin/tmux-fzf.zsh find '#{pane_current_path}'\"" \
- buf-files f "display-popup -E -w 100% \"~/bin/tmux-fzf.zsh buf-files '#{pane_current_path}'\"" \
git-files g "display-popup -E -w 100% \"~/bin/tmux-fzf.zsh git-files '#{pane_current_path}'\"" \
git-branches b "display-popup -E -w 100% \"~/bin/tmux-fzf.zsh git-branches '#{pane_current_path}'\"" \
git-commits c "display-popup -E -w 100% \"~/bin/tmux-fzf.zsh git-commits '#{pane_current_path}'\""
+++ /dev/null
-#!/bin/zsh
-
-typeset -A seen
-path-extractor | while read fn ; do
- [[ $seen[$fn] -eq 1 ]] && continue
- seen+=($fn 1)
- print $fn
-done | fzf -m
cut -c3- | fzf -m --preview="less -N -S {}" |
while read fn ; do print ${(q)fn} ; done > $tmp
;;
-(buf-files)
- tmux capture-pane -J
- tmux save-buffer $tmp.capture
- trap "rm -f $tmp.capture" HUP PIPE INT QUIT TERM EXIT
- tmux delete-buffer
- pe < $tmp.capture > $tmp
- ;;
(git-files) git status --short | fzf -m | perl -npe 's/^\s*\S+\s+//' > $tmp ;;
(git-branches) { git branch ; git branch --remote } | fzf > $tmp ;;
(git-commits)