}
bind-key t display-menu \
- music t "display-popup -E -w 100% '~/bin/tmux-menu-music.sh'" \
- pass p "display-popup -E '~/bin/tmux-menu-pass-session.sh'" \
- dict d "display-popup -E -h 100% '~/bin/tmux-menu-dict.sh'" \
- calc c "display-popup -E '~/bin/tmux-menu-calc.sh'" \
+ music t "display-popup -E -w 100% '~/.tmux/bin/menu-music.sh'" \
+ pass p "display-popup -E '~/.tmux/bin/menu-pass-session.sh'" \
+ dict d "display-popup -E -h 100% '~/.tmux/bin/menu-dict.sh'" \
+ calc c "display-popup -E '~/.tmux/bin/menu-calc.sh'" \
cal l "display-popup 'cal -3N'" \
top o "display-popup -E -h 100% 'top -s 1'"
bind-key o display-menu \
- find o "display-popup -E -w 100% \"~/bin/tmux-fzf.zsh find '#{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}'\""
+ find o "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh find '#{pane_current_path}'\"" \
+ git-files g "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-files '#{pane_current_path}'\"" \
+ git-branches b "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-branches '#{pane_current_path}'\"" \
+ git-commits c "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-commits '#{pane_current_path}'\""
--- /dev/null
+#!/usr/bin/env zsh
+
+cd $2
+set -e
+fpath=(~/.tmux/functions.zsh $fpath)
+autoload tmux-fzf-$1
+tmp=`mktemp`
+trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT
+tmux-fzf-$1 > $tmp || { echo unknown command ; sleep 1 ; exit }
+[[ -s $tmp ]] || exit
+tmux set-buffer "`perl -npe 's/\n/ /g' $tmp`"
+tmux paste-buffer
+tmux delete-buffer
--- /dev/null
+bfs -L . -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
--- /dev/null
+{ git branch ; git branch --remote } | sed "s/ //g" |
+fzf --preview "git log --oneline --graph --decorate=short --color=always {}"
--- /dev/null
+git --no-pager log --oneline -n 100 | perl -ne 'print "@~$n $_"; $n++' |
+fzf --reverse | cut -w -f1
--- /dev/null
+git status --short |
+fzf -m --delimiter " " --preview "git diff --color=always {-1}" |
+perl -npe 's/^\s*\S+\s+//'
+++ /dev/null
-#!/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 -L . -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
- ;;
-(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
#!/bin/zsh
-. ~/bin/tmux-common.sh
+. ~/.tmux/bin/common.sh
tmux has-session -t im && exit
tmux new-session -d -s im