GithubHelp home page GithubHelp logo

tmuxify's Introduction

TMUXIFY

tmuxify is a bash tool inspired in tmuxinator. The big difference is that it doesn't need Ruby.

TL;DR

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.

The .tmuxify.layout file

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

Files

tmuxify looks for a layout file in the current directory. If none is found it will default to ~/.tmuxify.layout.

Caveats

  1. The .tmuxify.layout file will need a pane-number even if the window has only one, like the vim example up there.

  2. All the commands will cd to the directory where the .tmuxify.layout file is in.

  3. The pane layout is always tiled.

  4. 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
    

Installation

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.

Why?

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.

Thanks

To inkel and djanowski for all their feedback :D

tmuxify's People

Contributors

alfredormz avatar starox avatar tonchis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tmuxify's Issues

Hyphenated project names make things weird.

So I have a lot of projects that have multiple components, and sometimes I name the directories app and app-web, the thing is: whenever I run tmuxify in app-web and the app session is alive it loads that one instead of app-web.

I think this is due to the | tr . - used when getting the session name, but I'm not sure why it's there, so I wanted to bring it up before submitting a patch.

Specify vertical splits

Probably one of my most common use cases is wanting to have 3 splits, with one of them being a full length vertical one, like so:

example

To achieve that we'd need to be able to specify whether a split is vertical or horizontal, there might still be some limits regarding ordering, but I don't have a problem with that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.