GithubHelp home page GithubHelp logo

nvdnkpr / termup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kenn/termup

0.0 2.0 0.0 843 KB

Automate opening up terminal tabs (or split panes) with a set of routine commands on OSX.

Home Page: http://rubygems.org/gems/termup

License: MIT License

termup's Introduction

Termup

Automate opening up terminal tabs (or split panes) with a set of routine commands.

It's the easiest way to get started for your projects every day.

Compatible with Terminal.app and iTerm 2 on Mac OS X 10.6 - 10.9 and Ruby 1.8.7 - 2.1.

Split Panes

For iTerm 1: Termup 2.0 and up is not compatible with iTerm 1. Install 1.3.1 by gem install termup -v=1.3.1

Installation

$ gem install termup

Note that you need to prepend sudo if you're using the OSX pre-installed Ruby.

Usage

Getting Started

Call the following command:

$ termup create myproject

This will create a new project at ~/.config/termup/myproject.yml. Edit the file:

$ termup edit myproject

And now you're good to go:

$ termup start myproject

YAML Syntax

# ~/.config/termup/myproject.yml
---
tabs:
  tab1:
    - cd ~/projects/foo
    - git status
    - subl .
  tab2:
    - mysql -u root
    - show databases;
  tab3:
    - cd ~/projects/foo
    - tail -f log/development.log
  tab4:
    - cd ~/projects/foo
    - autotest
options:
  iterm:
    width: 2
    height: 2

Tabs can contain a single command, or YAML arrays to execute multiple commands.

Shortcut

Commands have a shortcut for even fewer keystrokes.

$ termup s myproject

That's equivalent to termup start myproject.

iTerm 2 Split Pane Support

There are two options to deal with split panes on iTerm 2: --iterm_basic and --iterm_advanced

--iterm_basic

termup create myproject --iterm_basic

This will generate additional options in the config file:

options:
  iterm:
    width: 2
    height: 2

The setting above will generate four panes in the following layout.

#################
#       #       #
#   1   #   3   #
#       #       #
#################
#       #       #
#   2   #   4   #
#       #       #
#################

--iterm_advanced

termup create myproject --iterm_advanced

This will generate a config file in an advanced format:

# COMMENT OF SCRIPT HERE
---
tabs:
  pane1:
    commands:
      - echo pane1
    layout:
      - split_vertically
  pane2:
    commands:
      - echo pane2
    layout:
      - split_horizontally
  pane3:
    commands:
      - echo pane3
    layout:
      - split_horizontally
  pane4:
    commands:
      - echo pane4

The setting above will generate four panes in the following layout.

#################
#       #       #
#       #   2   #
#       #       #
#       #########
#       #       #
#   1   #   3   #
#       #       #
#       #########
#       #       #
#       #   4   #
#       #       #
#################

Available layout commands:

new_tab
close_tab
goto_previous_tab
goto_next_tab
goto_previous_pane
goto_next_pane
split_vertically
split_horizontally
go_left
go_right
go_down
go_up

termup's People

Contributors

berk avatar kenn 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.