GithubHelp home page GithubHelp logo

ttmux's Introduction

ttmux

A script that make easy tmux configuration bootstrap of a project

Install ttmux

To make ttmux executable from everywhere, add a symbolic link your /usr/local/bin folder

# cd /usr/local/bin
# ln -s ~/path/to/sensorario/ttmux/ttmux .

tmux configuration

Add these lines to your tmux.conf file, ore create it if not exists.

# start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1

configuration

This example create a basic configurtion where, ...

  • github checkout master branch
  • session is named "ttmux"
  • workspace windows will have a 20% pane, on the bottom
declare -A window_list=()
declare -A horizontal_panes=()
declare -A horizontal_panes_command=()
declare -A horizontal_panes_command_position=()

session_name="ttmux"
project_path='/path/to/project/folder'

window_list+=([workspace]="cd $project_path; vim")
window_list+=([mysql]="mysql -uroot sensorario")
window_list+=([console]="cd $project_path")

horizontal_panes+=([workspace]="")
horizontal_panes_command+=([workspace]="")
horizontal_panes_command_position+=([workspace]=2)

ordered_windows=(
    workspace
    mysql
    console
)

Tmux snippets

  • open horizontal pane Ctrl-b + "
  • open vertical pane Ctrl-b + %

ttmux's People

Contributors

sensorario avatar subidot avatar

Stargazers

lehung avatar  avatar Jean-Yves LEBLEU avatar

Watchers

James Cloos avatar  avatar

ttmux's Issues

Does not work on MacOsX

Due to a bash scripting version, ttmux does not work inside MacOsX terminal. This shell does not support associative arrays like:

declare -A window_list=()

And all generated windows in ordered_windows list, are created like the first one.

Create base configuration file

$ ttmux init

this command could create a base configuration file for current project. Depending on the kind of project, we could create a configuration file that tail php log if the project is a php project.

  • create a configuration file for php project
  • define a workspace file with all repositories and path related (eventually) to this project

cannot find ttmux:1

Seems that the first tmux windows has to be windows 0, suggest to change from start=1 to start=0 in line 94

Introduce workspaces

Should be available an unique window_list source file (a sort of worspace) and different ttmux order combination

  • define all window list
  • define all repositories
  • add check to li/utils function for configuration consistency

multiple configurations/behaviors

ordered_windows is the list of windows that will be opened. Instead of change them each time, ... just create some preset and select them asking to users which one to use in this session. Use select command of bash scripts

Manage branches

It should be possibile to work in different respositories during the same time. Even if a repository wont be loaded, it should be placed in the desired branch name.

TODO:

  • create a branch if not exists
  • check current branch in all related repositories
  • open all panes and windows with the same branch
  • fetch and pull master

Configuration file consistency

A configuration file must contain all of this definitions:

  • window_list
  • vertical_panes
  • pane_command
  • pane_command_position
  • order

display an appropriate message when a variable is missing

Missing suggested tmux configuration

According to #34 issue, add suggested tmux configuration inside README file

# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1

tmux: command not found

./startmux: line 26: tmux: command not found
./startmux: line 32: tmux: command not found
./startmux: line 36: tmux: command not found
./startmux: line 34: tmux: command not found
./startmux: line 36: tmux: command not found
./startmux: line 39: tmux: command not found
./startmux: line 40: tmux: command not found

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.