README.md
# itermp
[![NPM Version](https://badge.fury.io/js/itermp.svg)](https://badge.fury.io/js/itermp)
[![Maintainability](https://api.codeclimate.com/v1/badges/f04fc0e128b4c26fb190/maintainability)](https://codeclimate.com/github/Didericis/itermproj/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f04fc0e128b4c26fb190/test_coverage)](https://codeclimate.com/github/Didericis/itermproj/test_coverage)
[![CircleCI](https://circleci.com/gh/Didericis/itermp.svg?style=svg)](https://circleci.com/gh/Didericis/itermproj)
This project is intended for iterm users looking for a way to share and manage pane configurations. It's similar to [itermocil](https://github.com/TomAnthony/itermocil), but offers more flexibility and the ability to create local, project specific pane configurations.
### Demo
![image](https://media.giphy.com/media/1zk6hML6QxUNAQ4l1j/giphy.gif)
### Installation
```
npm install -g itermp
```
### Getting Started
When you install `itermp`, it will create a hidden folder in your home directory called `~/.itermp/`. This is where all your global pane configurations will live. Global pane configurations are iterm pane configurations that you can use from any directory. `itermp` ships with one global pane configuration called `basic`. To use it, run `itermp basic`.
If you open `~/.itermp/`, you should see a json file called `basic.json`. New global pane configurations can be added by creating new json files in this folder. You can see a list of all global pane configurations by running `itermp -l`, or by running `itermp` from a directory without a local `./itermp.json`.
### Configuration options
`./itermp.json`
```js
{
"fullscreen": true, // makes iTerm window fullscreen
"profile": "Perdy", // iTerm session profile to use for the pane
"rows": 20, // number of rows in for the pane
"columns": 180, // number of columns for the pane,
"command": "echo 'well hello there'", // command to run when the pane opens
"split": [{ // split can either be an array or an object
"type": "horizontally", // can either be "horizontally" or "vertically"
// ... can use pane configuration options from above (except fullscreen) and continue nesting
}]
}
```
### Local Pane Configurations
`itermp` also allows you to create local, project specific pane configurations. These configurations are defined in a file called `./itermp.json`. If you run `itermp` from a directory with an `./itermp.json` file, `itermp` will use the pane configuration defined in that file.
To create a local pane configuration, run `itermp -i`. This will create a blank `./itermp.json`. If you would like to copy a global pane configuration, you can specify a name (EX: `itermp -i basic`).
If you would like to make a local pane configuration globally available, you can run `itermp -g <name>` from a directory with a local `./itermp.json`.
### Bash Completion
If you would like to autocomplete global pane configurations, run `itermp completion >> ~/.bash_profile`. This will add a bash completion completions script generated by [yargs](https://github.com/yargs/yargs) to your bash profile.
### Troubleshooting
If you run into a problem, try running with the debug flag (`-d`). If you are unable to resolve your problem, please [file an issue](https://github.com/Didericis/itermp/issues).
### Example
This is the configuration used in the demo gif
`./itermp.json`
```js
{
"fullscreen": true,
"profile": "Perdy",
"rows": 80,
"columns": 400,
"command": "vi",
"split": [{
"type": "horizontally",
"profile": "Perdy Gears",
"rows": 30,
"command": "npm run start:watch",
"split": {
"type": "vertically",
"profile": "Perdy Gears",
"command": "npm run styleguide",
"split": {
"type": "vertically",
"profile": "Perdy Gears",
"command": "npm run coverage"
}
}
},
{
"type": "vertically",
"profile": "Perdy Coffee",
"columns": 120,
"command": "npm run test:client:watch",
"split": {
"type": "horizontally",
"profile": "Perdy"
}
}]
}
```
### License
[MIT license](LICENSE.md) © Eric Bauerfeld