aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--_zsh/80-tmux.zsh34
-rw-r--r--_zsh/90-aliases.zsh6
2 files changed, 34 insertions, 6 deletions
diff --git a/_zsh/80-tmux.zsh b/_zsh/80-tmux.zsh
new file mode 100644
index 0000000..ae0f1c5
--- /dev/null
+++ b/_zsh/80-tmux.zsh
@@ -0,0 +1,34 @@
+#
+# zsh/tmux.zsh
+#
+
+
+# Integrate `tmux` attach with `percol`
+# Credit: https://github.com/mooz/percol
+if exists percol; then
+ function tmattach() {
+ if [[ $1 == "" ]]; then
+ PERCOL=percol
+ else
+ PERCOL="percol --query $1"
+ fi
+
+ sessions=$(tmux list-sessions)
+ [ $? -ne 0 ] && return
+
+ session=$(echo ${sessions} | eval ${PERCOL} | cut -d: -f1)
+ if [[ -n "${session}" ]]; then
+ tmux attach -t ${session}
+ fi
+ }
+fi
+
+
+alias ta='tmux attach -t'
+alias tl='tmux list-sessions'
+alias ts='tmux new-session -s'
+alias tkss='tmux kill-session -t'
+alias tksv='tmux kill-server'
+
+
+# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: #
diff --git a/_zsh/90-aliases.zsh b/_zsh/90-aliases.zsh
index 1327721..a530fba 100644
--- a/_zsh/90-aliases.zsh
+++ b/_zsh/90-aliases.zsh
@@ -22,10 +22,4 @@ alias lsa='ls -lah'
alias grep='grep --color=auto'
-alias ta='tmux attach -t'
-alias tl='tmux list-sessions'
-alias ts='tmux new-session -s'
-alias tkss='tmux kill-session -t'
-alias tksv='tmux kill-server'
-
# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: #