A simple tmux plugin for managing "scratch" windows in a tmux popup.
- Per-session scratch window: A scratch window that is created for the current session and persists in the background. It can be quickly accessed via a popup.
- Global scratch window: A single, persistent scratch window that is shared across all sessions and can also be accessed via a popup.
- Status line indicator: The popup displays a transparent status line showing whether you're in the global or local scratch window.
- Quick session switching: A key binding to quickly create or attach to a new tmux session from the current pane's path.
- Toggle per-session scratch window:
M-i - Toggle global scratch window:
M-I - Create or attach to a new session:
prefix-n
tmux1.9 or higherbash
Installation with Tmux Plugin Manager (recommended)
Add the plugin to the list of TPM plugins in .tmux.conf:
set -g @plugin 'themastersheep/tmux-scratch'Hit prefix + I to fetch the plugin and source it.
Clone the repo:
git clone https://github.com/themastersheep/tmux-scratch ~/clone/pathAdd this line to the bottom of .tmux.conf:
run-shell ~/clone/path/scratch.tmuxReload the TMUX environment:
tmux source-file ~/.tmux.confYou can configure the key bindings and global scratch directory by adding the following to your .tmux.conf file:
-
@tmux_scratch_toggle_bind- Description: Key binding to toggle the per-session scratch window.
- Default:
M-i - Example:
set -g @tmux_scratch_toggle_bind "M-s"
-
@tmux_scratch_toggle_global_bind- Description: Key binding to toggle the global scratch window.
- Default:
M-I - Example:
set -g @tmux_scratch_toggle_global_bind "M-S"
-
@tmux_scratch_new_session_bind- Description: Key binding to create or attach to a new session.
- Default:
n(used with tmux prefix) - Example:
set -g @tmux_scratch_new_session_bind "N"
-
@tmux_scratch_global_dir- Description: Starting directory for the global scratch window.
- Default:
$HOME - Example:
set -g @tmux_scratch_global_dir "/tmp"