tmuxify
is a bash tool inspired in tmuxinator. The big difference is that it doesn't need Ruby.
Fire up tmux
with all the windows, panes and commands you need to start hacking at once!
You will need to create a .tmuxify.layout
file in the root of your project and run tmuxify
.
Each line of this file tells tmuxify
what to run, in what window and pane. It uses the following format
window-name pane-number command
Yes, separated by a single space. Everything after the pane-number
will be treated as part of the command
.
Say I need two windows, one for git
and one for vim
, then my .tmuxify.layout
file would look like:
git 1 git pull
vim 1 vim
Now I want the git
window to have a pane with a rack
server running.
git 1 git pull
git 2 rackup -p 8080
vim 1 vim
Get the idea? Go crazy.
You can also select which pane will have focus after attaching the session by adding a *
after the pane-number
git 1* git pull
git 2 rackup -p 8080
vim 1 vim
tmuxify
looks for a layout file in the current directory. If none is found it will default to ~/.tmuxify.layout
.
-
The
.tmuxify.layout
file will need apane-number
even if the window has only one, like thevim
example up there. -
All the
commands
willcd
to the directory where the.tmuxify.layout
file is in. -
The pane layout is always tiled.
-
The specified window names in the layout create new windows, so the first one is never used. Closing the first window will not renumber the existing ones. To fix that, add the following option in
~/.tmux.conf
set-option -g renumber-windows on
With Homebrew
brew tap tonchis/goodies && brew install tmuxify
Or standalone. Here's a oneliner.
$ wget https://raw.githubusercontent.com/tonchis/tmuxify/v1.2.1/bin/tmuxify && chmod +x tmuxify && sudo mv tmuxify /usr/local/bin
You can pass options to tmux with the TMUX_OPTS
environment variable if you need.
I love tmux
and the automation that tmuxinator
offers to speed up my development, yet I find that needing Ruby and YAML is a bit cumbersome, given the powerful CLI tools that tmux
offers.