X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=bin%2Fbin%2Ftmux-fzf.zsh;fp=bin%2Fbin%2Ftmux-fzf.zsh;h=0000000000000000000000000000000000000000;hp=bdf316c331383d96c55550682a00653b8369478e;hb=44c3c32ecd830b05572b3a4a7f22ba4ccb1b1f0a;hpb=547e9a22f3648349f0d690cbaa98e8ef3dcf329a diff --git a/bin/bin/tmux-fzf.zsh b/bin/bin/tmux-fzf.zsh deleted file mode 100755 index bdf316c..0000000 --- a/bin/bin/tmux-fzf.zsh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env zsh - -cd $2 -set -e -tmp=`mktemp` -trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT - -case $1 in -(find) - bfs . -mindepth 1 \ - -path "*/.git" -prune -o \ - -path "*/.redo" -prune -o \ - \( -type f -o -type d -o -type l \) -print | - 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) - git --no-pager log --oneline -n 20 | perl -ne "print \"@~\$n \$_\"; \$n++" | - fzf --reverse | cut -w -f1 > $tmp - ;; -(*) echo unknown command ; sleep 1 ; exit ;; -esac - -[ -s $tmp ] || exit -tmux set-buffer "`perl -npe 's/\n/ /g' $tmp`" -tmux paste-buffer -tmux delete-buffer