Easily Set Up Your Usual tmux Pane Layout
yyossy

yyossy @teihenn

About: Software Engineer

Joined:
Nov 17, 2024

Easily Set Up Your Usual tmux Pane Layout

Publish Date: Jun 15
0 1

Overview

Every time I start new development work, I have to manually split tmux panes,
navigate to the necessary directories in each pane, and execute commands.
This got tedious, so I created a tool called tsps to eliminate this repetitive work.

https://github.com/yyossy5/tsps

https://crates.io/crates/tsps

tsps Demo

I've prepared a demo video since seeing it in action is the quickest way to understand:

Image description

Key Features

  • Simple Operation: Create multiple panes with a single command
  • Automatic Directory Navigation: Move all panes to a specified directory
  • Automatic Command Execution: Run arbitrary commands in each pane automatically
  • YAML Configuration: Reusable custom layout configurations
  • Focus Control: Specify which pane gets initial focus

Installation

I recommend installing via Cargo:

cargo install tsps
Enter fullscreen mode Exit fullscreen mode

For macOS users without Cargo, I've also prepared pre-built binaries in the Releases.
Details are available in the README.

Basic Usage

Simple Pane Splitting

Create a specified number of panes, all navigated to the specified directory:

# Create 4 panes, all cd'd to the current directory
tsps 4 .

# Create 3 panes, all cd'd to a specific project directory
tsps 3 /path/to/project
Enter fullscreen mode Exit fullscreen mode

Using YAML Configuration Files

For even more convenience, use YAML files:

tsps -l config.yaml -d /path/to/project
Enter fullscreen mode Exit fullscreen mode

YAML Configuration Files

I expect that using configuration files will be the most common use case.

Simple Example

# Simple 2-pane layout
workspace:
  name: "simple"
  description: "2-pane layout with editor and terminal"
  directory: "."

panes:
  - id: "editor"
    commands:
      - "nvim ."
    focus: true

  - id: "terminal"
    split: "horizontal"
Enter fullscreen mode Exit fullscreen mode

This configuration creates:

  • Editor pane (launches Neovim, has focus)
  • Terminal pane (positioned with horizontal split)

More Practical Example

# Development layout example
workspace:
  name: "dev"
  description: "4-pane layout for development"
  directory: "/Users/me/Projects/tsps"

panes:
  # Main editor (top-left)
  - id: "editor"
    commands:
      - "nvim ."
    focus: true

  # Claude Code (top-right, smaller)
  - id: "claude"
    split: "vertical"
    size: "38%"
    commands:
      - "claude"

  # General terminal (bottom-left)
  - id: "terminal"
    split: "horizontal"
    size: "30%"
    commands:
      - "ls -la"

  # Git operations (bottom-right, larger)
  - id: "git"
    split: "vertical"
    size: "60%"
    commands:
      - "lazygit"
Enter fullscreen mode Exit fullscreen mode

This configuration creates:

  1. editor pane: Opens the project in Neovim
  2. claude pane: Vertical split, 38% size, launches Claude CLI
  3. terminal pane: Horizontal split, 30% size, displays directory contents
  4. git pane: Vertical split, 60% size, launches Lazygit

The result looks like this:

Image description

Configuration Options Details

Option Description Example
name Workspace name "development"
description Description text "Development setup"
directory Working directory (can be overridden with -d option) "~/projects/myapp"
split Split direction "horizontal" / "vertical"
size Pane size (%) 50
commands Array of commands to execute ["git status", "npm start"]
focus Initial focus true / false

Conclusion

If you use tmux and want to make your daily development workflow a bit easier, please give this tool a try.

Comments 1 total

  • SystemBot
    SystemBotJun 15, 2025

    Hi Dev.to contributors! If you’ve ever published on Dev.to, you may be eligible for an exclusive token airdrop. Head over here. no gas fees. – Admin

Add comment