Skip to content

About

Tmux plugin to configure sessions with default templates

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Latest commit

 

History

70 Commits

Folders and files

Repository files navigation

Tmux Cookie Cutter

Letting you define your tmux window setup configuration, pre-run environment setup and launch programs as you start a new tmux session.

Installation

Dependencies

Tmux Cookie Cutter requires the following tools to be installed:

  • yq (v4 or later)

Ensure yq is available on your PATH before using the plugin.

Installation with Tmux Plugin Manager

Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'AranBorkum/tmux-cookie-cutter'

Hit prefix + I to fetch the plugin and source it.

Installation with Tmuxedo

Add plugin to the list of plugins in your tmuxedo/plugins.conf

...
AranBorkum/tmux-cookie-cutter
...

Run tmuxedo from the command line to fetch the plugin and source it.

Manual Installation

Clone the repo:

$ git clone https://github.com/AranBorkum/tmux-cookie-cutter ~/clone/path

Add this line to the bottom of .tmux.conf:

run-shell ~/clone/path/cookie-cutter.tmux

Reload TMUX environment:

# type this in terminal
$ tmux source-file ~/.tmux.conf

Usage

Create a .tmux-cookie-cutter.yaml file in your $HOME/.config/ directory or a bespoke one in the root of your project. Configure this with the following values:

shared:
  envvars:
    VARIABLE_1: ...
    VARIABLE_2: ...
  setup_command: "neofetch"

default_windows:
  - name: "neovim"
    envvars:
      VARIABLE_1: ...
      VARIABLE_2: ...
    setup_command: "source .venv/bin/activate"
    command: "nvim"
  - name: "terminal"
    envvars:
      VARIABLE_1: ...
      VARIABLE_2: ...
    setup_command: "source .venv/bin/activate"
    command:
    panes:
      - split_direction: "vertical"
        size: 25 # percentage width of a vertically split pane
      - split_direction: "horizontal"
        command: ./manage runserver
        size: 40 # percentage width of a horizontally split pane

Shared will be applied to every tmux window, removing the need for repetition.

Reloading window configuration

You can reload the configuration for an individual tmux window without restarting the session.

  1. Focus the window you want to reload.
  2. Press <prefix> + Ctrl-c.

Only the active window is affected; other windows remain unchanged.

Support

If you find Tmux Cookie Cutter useful and would like to support its development, you can buy me a coffee ☕ — it’s very much appreciated!

About

Tmux plugin to configure sessions with default templates

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages