tmux chain keyboard shortcuts, or equivalent for screen's `bind -c` + `command -c`
After understanding better what you are trying to do, I think a short bash script is the best way to go (sorry, I don't think a tmux
-only solution similar to screen
command classes exists):
In .tmux.conf
:
bind-key x command-prompt -p "launch what?" " "run-shell \"tmux-launcher %%\""
tmux-launcher
should be an executable shell script somewhere in your path:
#!/bin/bash
case $1 in
o) tmux new-window -n imap -t 10 offlineimap.sh -o ;;
m) tmux new-window -n mod ncmpcpp ;;
w) tmux new-window -n vw vimwiki ;;
esac
One drawback is that you must type return after the letter that selects the window to create.
I was recently informed of the switch-client
approach to this
to bind join-pane
to prefix + t*
tmux bind-key t switch-client -Ttable1
tmux bind-key -Ttable1 '*' join-pane