An open API service indexing awesome lists of open source software.

https://github.com/tmpfs/mxl

Tmux launcher
https://github.com/tmpfs/mxl

Last synced: 15 days ago
JSON representation

Tmux launcher

Awesome Lists containing this project

README

        

Table of Contents
=================

* [Tmux Launcher](#tmux-launcher)
* [Install](#install)
* [Usage](#usage)
* [Quick Start](#quick-start)
* [Configuration Examples](#configuration-examples)
* [Developer](#developer)
* [Test](#test)
* [Cover](#cover)
* [Alias](#alias)
* [Docs](#docs)
* [Manual](#manual)
* [Readme](#readme)
* [License](#license)

Tmux Launcher
=============

Sources tmux profiles by invoking `source-file` helping to keep your tmux configurations portable.

This document is a brief introduction and guide, see `mxl help` and `mxl help ` for the man pages.

Requires [node](http://nodejs.org) and [tmux](https://tmux.github.io).

## Install

```
npm i -g mxl
```

## Usage

```
Usage: mxl [-anrh] [-a|--all] [-n|--noop]
[-r|--recursive] [--color|--no-color] [-h|--help]
[--version] [-c|--directory=]
[-p|--pattern=] [-s|--session=]

Tmux launcher.

Commands:
attach, att, a Attach to a session.
exec, ex Execute a command in a pane.
list, ls List configuration files.
source, so Source tmux configuration files.
alias, as Manage file aliases.
remove, rm Remove aliases by pattern match.
prune, pr Remove stale aliases.
index, idx Generate alias index.
kill, k Kill sessions, windows and panes.
install, i Install alias files.
view, vi View and edit configuration files.
quit Kill the tmux server.
help Show help for commands.

Options:
-c, --directory=[dir ...] Working directory contexts.
-p, --pattern=[ptn ...] Filter files by regexp pattern(s).
-a, --all Match all configuration files.
-n, --noop Print matched files, do not call source-file.
-s, --session=[name] Create session before source file(s).
-r, --recursive Match files recursively.
-h, --help Print help and exit.
--[no]-color Enable or disable terminal colors.
--version Print version and exit.

Report bugs to https://github.com/freeformsystems/mxl/issues.
```

## Quick Start

First install a scratch template into `$HOME`.

```
cd ~
mxl i @scratch
```

Modify `~/tmux.conf` to suit your needs then source it to create a scratch alias by username:

```
mxl .
```

Check the new alias exists:

```
mxl as
```

Then once you are in `tmux` you can launch the scratch template in your home directory:

```
mxl
```

Or from any directory with:

```
mxl @
```

Now go read the man pages!

## Configuration Examples

See the [templates](https://github.com/freeformsystems/mxl/blob/master/conf/tpl) for example `tmux` configuration files, these files become the global aliases on installation.

## Developer

Clone the repository, install deps (`npm i`) and symlink the executable in `$PATH`.

Install [vim-tmux](https://github.com/tmux-plugins/vim-tmux) if possible, it's very useful.

When `NODE_ENV` is set to `devel` error stack traces are printed and man pages may be generated dynamically (`NODE_ENV=devel mxl help`).

### Test

To run the test suite:

```
npm test
```

Note that the working directory for test execution is set to [fixtures/conf](https://github.com/freeformsystems/mxl/blob/master/test/fixtures/conf).

Run an individual test spec with `TEST_SPEC`:

```
TEST_SPEC=test/spec/context npm test
```

### Cover

To generate code coverage:

```
npm run cover
```

### Alias

To rebuild the default rc file aliases from the files in [tpl](https://github.com/freeformsystems/mxl/blob/master/conf/tpl) run:

```
npm run alias
```

This is automatically called on `postinstall` to ensure shipped aliases are correct.

### Docs

To build all documentation:

```
npm run docs
```

### Manual

To build all man pages (requires [manpage](https://github.com/freeformsystems/cli-manpage)):

```
npm run manual
```

### Readme

To build the readme file from the partial definitions (requires [mdp](https://github.com/freeformsystems/mdp)):

```
npm run readme
```

## License

Everything is [MIT](http://en.wikipedia.org/wiki/MIT_License). Read the [license](https://github.com/freeformsystems/mxl/blob/master/LICENSE) if you feel inclined.

Generated by [mdp(1)](https://github.com/freeformsystems/mdp).

[node]: http://nodejs.org
[npm]: http://www.npmjs.org
[mdp]: https://github.com/freeformsystems/mdp
[manpage]: https://github.com/freeformsystems/cli-manpage
[tmux]: https://tmux.github.io
[vim-tmux]: https://github.com/tmux-plugins/vim-tmux