• Stars
    star
    1,018
  • Rank 45,203 (Top 0.9 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tmuxify your Tmux. Powerful session, window & pane management for Tmux.

Tmuxifier Build Status

Tmuxify your Tmux. Create, edit, manage and load complex Tmux session, window and pane configurations with ease.

In short, Tmuxifier allows you to easily create, edit, and load "layout" files, which are simple shell scripts where you use the tmux command and helper commands provided by tmuxifier to manage Tmux sessions and windows

Window Layouts

Window layouts create a new Tmux window, optionally setting the window title and root path where all shells are cd'd to by default. It allows you to easily split a window into specifically sized panes and more as you wish.

You can load a window layout directly into your current Tmux session, or into a session layout to have the window created along with the session.

Session Layouts

Session layouts create a new Tmux session, optionally setting a session title and root path where all shells in the session are cd'd to by default. Windows can be added to the session either by loading existing window layouts, or defined directly within the session layout file.

Example

Given we have a window layout file called example.window.sh which looks like:

window_root "~/Desktop"
new_window "Example Window"
split_v 20
run_cmd "watch -t date"
split_h 60
select_pane 0

You can then load that window layout into a new window in the current tmux session using:

tmuxifier load-window example

Which will yield a Tmux window looking like this:

example

Installation

Manual

Clone the repo to your machine:

git clone https://github.com/jimeh/tmuxifier.git ~/.tmuxifier

Then add $HOME/.tmuxifier/bin to your PATH to make the tmuxifier executable available to you:

In bash & zsh:

export PATH="$HOME/.tmuxifier/bin:$PATH"

In tcsh:

set path = ( "~/.tmuxifier/bin" $path )

In fish:

set -gx PATH "~/.tmuxifier/bin" $PATH

Custom Installation Path

To install Tmuxifier somewhere else than the suggested ~/.tmuxifier, simply clone the repository to your custom location, and ensure the bin folder is added to your PATH making the tmuxifier executable available to you.

TPM

You can also install and update Tmuxifier with TPM:

set -g @plugin 'jimeh/tmuxifier'

Trigger TPM's install command with prefix + I to install Tmuxifier to TPM's plugin directory (default is $HOME/.tmux/plugins).

To use the tmuxifier command, you will need to add the bin directory to your PATH. If you are using the default TPM plugin directory, the bin directory will be $HOME/.tmux/plugins/tmuxifier/bin.

Setup

In bash & zsh:

And add the following to your ~/.profile, ~/.bash_profile, ~/.zshrc or equivalent:

eval "$(tmuxifier init -)"

In tcsh:

Add the following to your ~/.cshrc, ~/.tcshrc or equivalent:

eval `tmuxifier init -`

In fish:

And add the following to your ~/.config/fish/config.fish or equivalent:

eval (tmuxifier init - fish)

Custom Tmux Arguments

If you need to pass custom arguments to tmux itself, you can do so by setting the TMUXIFIER_TMUX_OPTS environment variable. For example to set custom arguments globally:

export TMUXIFIER_TMUX_OPTS="-L my-awesome-socket-name"
eval "$(tmuxifier init -)"

And/or specify dynamically when calling tmuxifier:

TMUXIFIER_TMUX_OPTS="-L other-socket" tmuxifier load-session welcome

Updating

cd ~/.tmuxifier # or where you've cloned tmuxifier to
git pull

Usage

Note: This section needs expanding upon.

For a quick reference on available commands and their aliases, please run:

tmuxifier help

Tmuxifier doesn't come with any layouts, so you'll want to create your own window and session layout files. New layout files are populated with examples and comments explaining what things do. Also, having a look at the examples directory will also give you a good idea.

Window Layouts

First off you'll want to define a window layout:

tmuxifier new-window my-awesome-window

This will create a new layout file called my-awesome-window.window.sh in your $TMUXIFIER_LAYOUT_PATH, and open it with the editor defined in $EDITOR. Customize it as you wish, and save.

You can now load my-awesome-window with the following command:

tmuxifier load-window my-awesome-window

You should now have a new Tmux window open created from your custom and awesome window layout.

Session Layouts

To create your first session layout, run:

tmuxifier new-session my-awesome-session

Same deal as with creating a new window, except the filename ends with .session.sh instead of .window.sh, and the file's pre-populated content looks different. To have your awesome window loaded, add load_window "my-awesome-window" to the session layout next to existing examples.

To load the session layout simply run:

tmuxifier load-session my-awesome-session

You'll now have a new Tmux session with your previously defined awesome window in it.

Configure & Customize

Custom Layouts Path

You can customize the layouts directory used by Tmuxifier by setting $TMUXIFIER_LAYOUT_PATH.

export TMUXIFIER_LAYOUT_PATH="$HOME/.tmux-layouts"

Disable Shell-Completion

Tmuxifier comes with shell-completion for bash, zsh, tcsh, and fish. If for any reason you need to disable it, just set $TMUXIFIER_NO_COMPLETE.

export TMUXIFIER_NO_COMPLETE=1

Tips

iTerm2 Integration

Tmuxifier supports iTerm2's Tmux integration. It can be used in two ways:

  • Passing -CC as a second argument to the load-session command. For example:

        tmuxifier load-session my-awesome-session -CC
    
  • Setting the TMUXIFIER_TMUX_ITERM_ATTACH environment variable to -CC before calling the load-session command.

Inspiration

  • Tmuxifier is largely inspired by Tmuxinator.
  • The shell script structure and shell-completion setup is heavily inspired/ripped from the internals of rbenv.

Tmuxifier vs. Tmuxinator

Though Tmuxifier is largely inspired by the excellent Tmuxinator project, it does set itself apart in a number of ways:

  • Uses shell scripts to define Tmux sessions and windows instead of YAML files. The benefit is total control over Tmux, but the definition files are more complicated to work with.
  • Instead of using a "project" concept, Tmuxifier uses a concept of "sessions" and "windows" just like Tmux itself. This allows you to load a whole session with multiple pre-defined window configurations, or just load a single window configuration into your existing session.
  • Tmuxifier is a set of shell scripts, meaning it doesn't require Ruby to be installed on the machine.

Todos

  • Improve Readme, specially Usage section.
  • Write up a detailed reference for all available layout helper functions.

License

(The MIT license)

Copyright (c) 2014 Jim Myhrberg.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Shell
2,139
star
2

tmux-themepack

A pack of various Tmux themes.
Go
1,564
star
3

build-emacs-for-macos

Somewhat hacky script to automate building of Emac.app on macOS.
Go
434
star
4

emacs-builds

Self-contained Emacs.app builds for macOS, with native-compilation support.
Go
333
star
5

manservant

Browse man pages in style with your personal manservant.
Perl
164
star
6

redistat

A Redis-backed statistics storage and querying library written in Ruby.
Ruby
155
star
7

docker-znc

Run the ZNC IRC Bouncer in a Docker container.
Shell
134
star
8

zsh-peco-history

Search shell history with peco when pressing ctrl+r.
Shell
122
star
9

PastryKit

A little-known and unreleased iPhone web-app Javascript framework developed by Apple.
JavaScript
104
star
10

.emacs.d

My personal Emacs config with any quirks, oddities, bugs, and man-eating errors I live with on a daily basis.
Emacs Lisp
98
star
11

twilight-bright-theme.el

A Emacs port of the TextMate theme by the same name with some minor tweaks and additions.
Emacs Lisp
63
star
12

stub.sh

Helpers for bash script testing to stub/fake binaries and functions. Includes support for validating number of stub calls, and/or if stub has been called with specific arguments.
Shell
53
star
13

php-rack

An implementation of the middleware execution stack from Ruby's Rack library, for PHP.
PHP
52
star
14

common-flow

An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification.
41
star
15

dotfiles

My personals dotfiles with any quirks, oddities, bugs, and man-eating errors I live with on a daily basis.
Shell
40
star
16

twilight-anti-bright-theme

A light-on-dark Emacs and TextMate theme inspired by the dark-on-light Twilight Bright TextMate theme.
Emacs Lisp
40
star
17

birds-of-paradise-plus-theme.el

A Emacs port of Joseph Bergantine's light-on-dark theme by the same name.
Emacs Lisp
38
star
18

node-base58

Base58 encoding and decoding for Node.js
JavaScript
33
star
19

rubocopfmt.el

Emacs minor-mode to format Ruby code with RuboCop on save.
Emacs Lisp
16
star
20

go-midjourney

Go
15
star
21

760-grid-system

Use the same principals of the 960 grid system within Facebook's 760 pixel wide frame for Facebook Applications.
Ruby
15
star
22

jimeh.me-v3.0

Jekyll project of a old version my personal website and blog.
CSS
13
star
23

tomorrow-night-paradise-theme.el

A light-on-dark Emacs theme which is essentially a tweaked version of Chris Kempson's Tomorrow Night Bright theme.
Emacs Lisp
11
star
24

litemysql

Very light-weight and simple ORM-like MySQL library for PHP. Kind of like ActiveRecord's little brother.
PHP
11
star
25

amqp-failover

Add multi-server support with failover and fallback to the amqp gem.
Ruby
10
star
26

jimeh.github.io

This is the source-code for my personal website.
SCSS
9
star
27

homebrew-emacs-builds

Ruby
8
star
28

suggest_results

Easily customizable search suggestion plugin for jQuery, which suggests results directly, rather than search terms.
JavaScript
7
star
29

yank-indent

Emacs minor-mode that ensures pasted (yanked) text has the correct indentation level.
Emacs Lisp
7
star
30

collecta_ruby

A light Ruby library / Rails plugin for querying the Collecta API.
Ruby
7
star
31

ansible-adguardhome

Ansible role to install and run AdGuard Home, with support for non-root operation.
Python
7
star
32

mta-sts-on-github-pages

Template repository for hosting MTA-STS (.well-known/mta-sts.txt) on GitHub Pages.
6
star
33

go-golden

Yet another Go package for working with *.golden test files, with a focus on simplicity.
Go
6
star
34

airbrake-statsd

Extends the Airbrake gem to also report exceptions to Esty's StatsD statistics aggregator.
Ruby
6
star
35

greek_easter

Never wonder again when easter is in Greece.
Ruby
6
star
36

facebooker_plus

A Ruby on Rails plugin fixing, extending and adding features to Facebooker, possibly beyond the originally intended scope of Facebooker itself.
Ruby
5
star
37

fancy_input

Easily customizable search suggestion plugin for jQuery, which suggests results directly, rather than search terms. (Formally known as suggest_results)
JavaScript
5
star
38

casecmp

Case-insensitive string comparison, as an API. Because Β―\_(ツ)_/Β―
Go
5
star
39

docker-flexget

Simple Docker container for running Flexget
Shell
4
star
40

zynapse

Rails-like MVC framework for PHP5. Currently abandoned and published for educational reasons.
JavaScript
4
star
41

twhois

Whois-like command-line tool and Ruby Gem for Twitter users
Ruby
3
star
42

undent

Go package which removes leading indentation/white-space from strings.
Go
3
star
43

tab-bar-notch

Adjust tab-bar height for MacBook Pro notch
Emacs Lisp
3
star
44

Dockerfiles

Small collection of Docker and Docker Compose files I use to run stuff on my personal laptop
Shell
3
star
45

time_ext

Extends the abilities of Ruby's built-in Time class by building on top of ActiveSupport.
Ruby
3
star
46

standardfmt.el

Emacs minor-mode to format JavaScript with standard / semistandard on save.
Emacs Lisp
3
star
47

960-grid-system-plus

A clone/enhancement of the excellent 960 Grid System by Nathan Smith to fit my personal likes and dislikes.
3
star
48

skyline

Ruby-based interactive shell tools to send terminal commands to instances in Amazon EC2 AutoScaling groups
Ruby
2
star
49

fastmail-rules

Go
2
star
50

kotaku-uk-rss

Small experimental web-scraper to provide a RSS feed of kotaku.co.uk for my own personal use.
Go
2
star
51

skyhook

A customized set of scripts and config files to deploy projects and control services on Amazon EC2.
Ruby
2
star
52

rubocopfmt

DEPRECATED! Easy formatting of Ruby code using rubocop. Analogous to gofmt.
Ruby
2
star
53

terraform-cloudflare-email

Terraform module to configure various email related DNS records on Cloudflare.
HCL
2
star
54

envctl

Go package providing test helper functions to temporarily change and restore environment variables.
Go
1
star
55

git-basics

A basic intro to git
1
star
56

cloudflare-dyndns

Go
1
star
57

chef-btsync

A simple and quickly hacked together chef cookbook for installing and configuring BTSync on Ubuntu for my own personal needs.
Ruby
1
star
58

rands

Go package providing a suite of functions that use crypto/rand to generate cryptographically secure random strings in various formats.
Go
1
star
59

tmux-themepack-previews

This holds nothing interesting. Go check out the Tmux Themepack project instead.
Shell
1
star
60

blank_gem

A blank/empty Ruby gem that does nothing.
Ruby
1
star
61

modern_bubbling

An Adium message style.
JavaScript
1
star
62

seedsafe

An attempt to learn about AES encryption.
Go
1
star
63

heartb.it

Ruby
1
star
64

mje

Go
1
star
65

pylight

Quick hack to create an HTTP API for accessing Pygments, and to start teaching myself Python.
Python
1
star
66

bah.io

Static landing page for bah.io
HTML
1
star
67

jimeh.me-api

Experimental project to rewrite my site and blog to run off of an EventMachine-based API. Cause it's fun ^_^
Ruby
1
star
68

update-tags-action

Easily create/update one or more Git tags in a GitHub repository.
JavaScript
1
star
69

play-store-notifier

Small shitty script I originally used to notify myself via email of when the Nexus 4 came back in stock. Now using it to find out when the Nexus 5 becomes available on the Play Store.
Ruby
1
star
70

rbheap

A tool to help with tracking down memory leaks in Ruby.
Go
1
star
71

ps4-20th-tool

A small tool built for educational purposes that attempts to pick apart Sony's 20 Years Of Character's website to find the secret URL.
Go
1
star