Skip to content

Commit

Permalink
docs: update docs & tmux-backup.tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
graelo committed Oct 30, 2022
1 parent 55ea13b commit d6446b6
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 10 deletions.
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ By default, the tmux bindings for listing backups are
- `prefix + b + l` to show the simple catalog
- `prefix + b + L` to show the detailed catalog (adds the filesize, version & content columns)

Both of them will open a tmux popup.
Both of these bindings will open a tmux popup showing the catalog content.

### Save the current tmux environment

Expand All @@ -90,18 +90,24 @@ Both of these bindings will print the same report as above in the tmux status ba
Typing `tmux-backup restore` in your shell outside of tmux will

- start a tmux server if none is running
- restore the sessions
- restore all sessions from the latest backup
- but you still have to `tmux attach -t <your-last-session>`

The same command typed in a shell inside tmux will erase session `0` (the default start
session) and restore your tmux environment in place.

By default, the tmux binding for restoring the latest backup is

- `prefix + b + r` restore sessions from the latest backup

## Installation

### Installing the binary

On macOS

```shell
brew install graelo/homebrew-tap/tmux-backup
brew install graelo/homebrew-tap/tmux-backup # will also install shell completions
```

On linux
Expand All @@ -113,8 +119,29 @@ curl \
chmod +x /usr/local/bin/tmux-backup
```

If you use tpm, copy the file `tmux-backup.tmux` to `~/.tmux/plugins/tmux-backup/tmux-backup.tmux` and
declare the tmux-backup plugin to TPM in your `~/.tmux.conf`:
On linux, to install completions, type

```shell
tmux-backup generate-completion zsh|bash|fish > /path/to/your/completions/folder
```

### Installing the tmux plugin hook

Type

```shell
mkdir ~/.tmux/plugins/tmux-backup
tmux-backup generate-tmux-plugin-config > ~/.tmux/plugins/tmux-backup/tmux-backup.tmux
```

If you don't use [tpm](https://github.com/tmux-plugins/tpm), just add this to your
`.tmux.conf`:

```text
source-file ~/.tmux/plugins/tmux-backup/tmux-backup.tmux
```

Alternatively, if you use tpm, declare the tmux-backup plugin to TPM in your `~/.tmux.conf`:

```tmux
set -g @tpm_plugins ' \
Expand Down
37 changes: 32 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
//! - `prefix + b + l` to show the simple catalog
//! - `prefix + b + L` to show the detailed catalog (adds the filesize, version & content columns)
//!
//! Both of them will open a tmux popup.
//! Both of these bindings will open a tmux popup showing the catalog content.
//!
//! ### Save the current tmux environment
//!
Expand All @@ -82,18 +82,24 @@
//! Typing `tmux-backup restore` in your shell outside of tmux will
//!
//! - start a tmux server if none is running
//! - restore the sessions
//! - restore all sessions from the latest backup
//! - but you still have to `tmux attach -t <your-last-session>`
//!
//! The same command typed in a shell inside tmux will erase session `0` (the default start
//! session) and restore your tmux environment in place.
//!
//! By default, the tmux binding for restoring the latest backup is
//!
//! - `prefix + b + r` restore sessions from the latest backup
//!
//! ## Installation
//!
//! ### Installing the binary
//!
//! On macOS
//!
//! ```shell
//! brew install graelo/homebrew-tap/tmux-backup
//! brew install graelo/homebrew-tap/tmux-backup # will also install shell completions
//! ```
//!
//! On linux
Expand All @@ -105,8 +111,29 @@
//! chmod +x /usr/local/bin/tmux-backup
//! ```
//!
//! If you use tpm, copy the file `tmux-backup.tmux` to `~/.tmux/plugins/tmux-backup/tmux-backup.tmux` and
//! declare the tmux-backup plugin to TPM in your `~/.tmux.conf`:
//! On linux, to install completions, type
//!
//! ```shell
//! tmux-backup generate-completion zsh|bash|fish > /path/to/your/completions/folder
//! ```
//!
//! ### Installing the tmux plugin hook
//!
//! Type
//!
//! ```shell
//! mkdir ~/.tmux/plugins/tmux-backup
//! tmux-backup generate-tmux-plugin-config > ~/.tmux/plugins/tmux-backup/tmux-backup.tmux
//! ```
//!
//! If you don't use [tpm](https://github.com/tmux-plugins/tpm), just add this to your
//! `.tmux.conf`:
//!
//! ```text
//! source-file ~/.tmux/plugins/tmux-backup/tmux-backup.tmux
//! ```
//!
//! Alternatively, if you use tpm, declare the tmux-backup plugin to TPM in your `~/.tmux.conf`:
//!
//! ```tmux
//! set -g @tpm_plugins ' \
Expand Down

0 comments on commit d6446b6

Please sign in to comment.