GithubHelp home page GithubHelp logo

optionalg / tmuxify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tonchis/tmuxify

0.0 2.0 0.0 14 KB

tmuxify is a bash tool inspired in [tmuxinator](https://github.com/tmuxinator/tmuxinator)

License: MIT License

Shell 100.00%

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

tonchis avatar alfredormz avatar starox avatar

Watchers

 avatar  avatar

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.