Home

Awesome

tmux-named-snapshot

This plugin will allow you to save and restore tmux-resurrect snapshots into its own separate snapshot, making it easy to keep track of tmux session setup.

Getting Started

This plugin is shipped with these key bindings

Check out Configurations section below to customize the key bindings and any additional options.

Configurations

Each mapping should consists of key and its corresponding snapshot name. So a mapping of C-m:manual will map a manual snapshot to C-m key binding.

A special snapshot name * will prompt for a snapshot name before performing the action.

You can always map multiple key bindings to the same snapshot name.

Examples

To setup the key bindings, the configuration should be put in .tmux.conf file.

For example,

set -g @named-snapshot-save 'C-m:manual M:* C-d:dev'
set -g @named-snapshot-restore 'C-n:manual N:* D:dev'

will setup the following key bindings

You can also define a separate "namespace" for all save/restore bindings using switch-client feature in tmux.

To do this, define the @named-snapshot-switch-client parameter with a value of type N:tns, where N (stands for Named) is the preferred key to enter "Named Snapshot Mode" and tns (stands for tmux-named-snapshot) is the name of the key-table for the switch-client.

For example,

set -g @named-snapshot-switch-client 'N:tns'
set -g @named-snapshot-save 'm:manual p:* d:dev'
set -g @named-snapshot-restore 'M:manual P:* D:dev'

will setup the following key bindings

While in this mode:

Installation

Requirements

Please note that this plugin utilize multiple unix tools to deliver its functionalities (most of these tools should be already installed on most unix systems)

Using TPM

set -g @plugin 'spywhere/tmux-named-snapshot'

Manual

Clone the repo

$ git clone https://github.com/spywhere/tmux-named-snapshot ~/target/path

Then add this line into your .tmux.conf

run-shell ~/target/path/named-snapshot.tmux

Once you reloaded your tmux configuration, all the format strings in the status bar should be updated automatically.

License

MIT