Skip to content

dikkadev/tmsave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

tmsave

Save and restore tmux pane layouts per directory.

Installation

Source the script in your shell config:

source /path/to/tmsave.sh

Dependency: jq (for JSON parsing on restore)

Usage

Save layout

cd ~/myproject
# Set up your panes how you like them
tmsave

Restore layout

cd ~/myproject
tmre

Apply layout from another directory (git worktrees)

Pass a directory to load its layout and apply it to your current directory. Subdirectory panes are mapped relatively.

# You have a layout saved for your main worktree
cd ~/myproject-feature-branch
tmre ~/myproject

# Pane that was at ~/myproject/ui → opens at ~/myproject-feature-branch/ui

List saved layouts

tmlist          # Human-readable table
tmlist --json   # JSON array for scripting

Move layout to new path

When you relocate a project:

tmsavemv ~/old/path ~/new/path

Help

All commands support -h / --help:

tmsave --help
tmre --help
tmlist --help
tmsavemv --help

How it works

  • Layouts are stored in ~/.local/share/tmsave/layouts/
  • Indexed by base64-encoded directory path
  • Saves: pane geometry, subdirectory paths, active pane
  • Restores: recreates panes, applies layout, cds into subdirectories only where needed

Notes

  • Run tmsave from the project root directory
  • Panes in subdirectories are restored with relative cd
  • Panes outside the base directory stay at the base on restore (warning shown on save)

About

Save and restore tmux pane layouts per directory

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages