Skip to main content

Optimal, opinionated, batteries-included TMUX that's neat and easy for any project

Project description

optmux

optmux logo

Optimal, opinionated, batteries-included TMUX that's neat and easy for any project.

A tmuxp wrapper that creates per-project tmux config directories with TPM and plugins pre-configured.

Quick Start

# run optmux anywhere (installs on first use via uv)
uvx optmux

# strongly recommended: install wtcode + lazygit for the full experience
brew install netj/tap/optmux

Try the included example:

git clone https://github.com/netj/optmux.git && cd optmux
./example.optmux.yaml

On first run, optmux will:

  1. Create .example.optmux.d/tmux/ next to the YAML file
  2. Seed a default tmux.conf with TPM and plugins
  3. Install TPM and all plugins (visible in window 0)
  4. Launch tmuxp with an isolated tmux server

Usage

With a tmuxp YAML file

Supports .optmux.yaml, .tmuxp.yaml, and .optmuxp.yaml extensions:

optmux myproject.optmux.yaml
optmux myproject.tmuxp.yaml

Without arguments

optmux

Opens plain tmux using .optmux.d/ in the current directory — useful for a quick, isolated tmux session with the bundled config.

As a shebang

Write a tmuxp YAML config with the optmux shebang line and make it executable:

#!/usr/bin/env -S uvx optmux
session_name: myproject
windows:
  - window_name: editor
    panes:
      - vim .
  - window_name: shell
    panes:
      - ""
chmod +x myproject.optmux.yaml
./myproject.optmux.yaml

Example tmuxp YAML

Here's the included example.optmux.yaml showing shortcuts, tmux config, and window layout:

#!/usr/bin/env -S uvx optmux
session_name: example
start_directory: .

optmux:
  shortcuts:
    C-M-b: gh browse .
    C-M-e:
      command: ${VISUAL:-${EDITOR:-vim}} README.md  # exec directly (default for str, no latency)
      window: true                                  # in a new-window
    E:
      send-keys: ${VISUAL:-${EDITOR:-vim}} .        # send-keys (given command is run in a new shell)
      zoom: false                                   # do not zoom (defaults to zoom when split-window)
  tmux_config:
    project-settings: |
      set -g status-style bg=blue

windows:
  - window_name: editor
    panes:
      - vim .
  - window_name: shell
    panes:
      - ""
  - window_name: logs
    panes:
      - tail -f /var/log/system.log

Config directory

Each project gets its own .$NAME.optmux.d/ directory:

Path Purpose
tmux/tmux.conf Main tmux config (editable after creation)
tmux/tmux.*.conf Additional config files you can add
tmux/tmux.sock Tmux server socket (isolates this project)
tmux/plugins/ TPM plugin directory
tmux/plugins-update.sh Run manually to update all plugins

optmux YAML config

Add an optmux: section to your tmuxp YAML to configure shortcuts and tmux settings:

optmux:
  shortcuts:
    C-M-b: gh browse .                              # Ctrl-Alt-b: run command directly
    C-M-e:
      command: ${VISUAL:-${EDITOR:-vim}} README.md  # exec directly (no shell)
      window: true                                  # open in a new-window
    E:
      send-keys: ${VISUAL:-${EDITOR:-vim}} .        # send-keys (runs in a new shell)
      zoom: false                                   # do not zoom (default: true for splits)
  tmux_config:
    project-settings: |
      set -g status-style bg=blue

Shortcuts

Shortcuts bind tmux keys to commands:

  • C-M-* keys are bound globally (no prefix needed)
  • Other keys require the tmux prefix (C-t)
  • command: executes directly (default for string values)
  • send-keys: sends the command to a new shell (supports shell expansion)
  • window: true opens in a new window instead of a split
  • zoom: false disables auto-zoom on splits (default: true)

tmux_config

Entries under tmux_config: are written as tmux.optmux-extras.{name}.conf files and auto-sourced by tmux.

Personal config (~/.optmux.yaml)

Create ~/.optmux.yaml to define personal defaults that apply to all optmux sessions:

optmux:
  shortcuts:
    C-M-g: lazygit
  tmux_config:
    my-defaults: |
      set -g status-style bg=green

Personal config is merged with per-project config. When both define the same key, personal settings take precedence.

Customization

  • Edit tmux/tmux.conf to change tmux settings
  • Drop tmux/tmux.mysetup.conf files for additional config (auto-sourced)
  • Run tmux/plugins-update.sh from inside tmux to update plugins
  • Press prefix + R to reload the config

Environment variables

optmux sets these before launching tmux/tmuxp:

Variable Value
OPTMUX_DIR Absolute path to the .$NAME.optmux.d/ directory
OPTMUX_NAME Name derived from YAML filename or cwd (e.g., myproject)
TMUX_PLUGIN_MANAGER_PATH $OPTMUX_DIR/tmux/plugins

Development

# install the latest main branch
uvx git+https://github.com/netj/optmux.git

# local editable install for development
uv tool install -e .

# test any local changes directly (best for testing branches)
uv run optmux ./example.optmux.yaml

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optmux-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optmux-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file optmux-0.1.0.tar.gz.

File metadata

  • Download URL: optmux-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for optmux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c0f12c34c165c6ede88f6bdfb3cf3d7d2a9bd5baa1e3e74b6cf00dfe7fcbd5a
MD5 9fd6845424552d576a6ad93a53728de1
BLAKE2b-256 2b3d3221de4a4bceaaa5227b26131c4c9c436127a24cf45e8dc71866f57bd4cc

See more details on using hashes here.

File details

Details for the file optmux-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: optmux-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for optmux-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03273268bb8b5582c1e2285c9bf13efd3c5563288d38815aafc86a2b17637bdd
MD5 e7ba9ee0333da0c59208020b5f797516
BLAKE2b-256 4ff787724d0308aa2c86952a465c4576b92f605143c0bb935320494201baccae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page