tmux-resurrect/README.md

130 lines
4.6 KiB
Markdown
Raw Permalink Normal View History

# Tmux Resurrect
2014-08-25 19:52:07 +00:00
2017-11-14 10:40:05 +00:00
[![Build Status](https://travis-ci.org/tmux-plugins/tmux-resurrect.svg?branch=master)](https://travis-ci.org/tmux-plugins/tmux-resurrect)
2015-02-23 00:21:13 +00:00
2015-03-18 01:33:13 +00:00
Restore `tmux` environment after system restart.
2014-08-26 14:07:04 +00:00
2014-08-30 14:24:54 +00:00
Tmux is great, except when you have to restart the computer. You lose all the
2014-08-27 19:31:10 +00:00
running programs, working directories, pane layouts etc.
There are helpful management tools out there, but they require initial
configuration and continuous updates as your workflow evolves or you start new
projects.
2014-08-30 14:24:54 +00:00
`tmux-resurrect` saves all the little details from your tmux environment so it
2014-08-29 17:12:28 +00:00
can be completely restored after a system restart (or when you feel like it).
No configuration is required. You should feel like you never quit tmux.
2014-08-27 19:31:10 +00:00
2015-08-10 16:51:39 +00:00
It even (optionally)
[restores vim and neovim sessions](docs/restoring_vim_and_neovim_sessions.md)!
2014-08-27 23:09:55 +00:00
Automatic restoring and continuous saving of tmux env is also possible with
[tmux-continuum](https://github.com/tmux-plugins/tmux-continuum) plugin.
2014-08-30 08:48:59 +00:00
### Screencast
[![screencast screenshot](/video/screencast_img.png)](https://vimeo.com/104763018)
2014-08-27 23:09:55 +00:00
### Key bindings
2014-09-20 20:45:37 +00:00
- `prefix + Ctrl-s` - save
- `prefix + Ctrl-r` - restore
2014-08-31 09:35:58 +00:00
2014-08-27 19:31:10 +00:00
### About
This plugin goes to great lengths to save and restore all the details from your
`tmux` environment. Here's what's been taken care of:
- all sessions, windows, panes and their order
- current working directory for each pane
- **exact pane layouts** within windows (even when zoomed)
2014-08-27 19:31:10 +00:00
- active and alternative session
- active and alternative window for each session
2014-08-29 15:04:00 +00:00
- windows with focus
2014-08-27 19:31:10 +00:00
- active pane for each window
2015-02-10 00:49:26 +00:00
- "grouped sessions" (useful feature when using tmux with multiple monitors)
2014-08-28 23:04:03 +00:00
- programs running within a pane! More details in the
2015-08-10 16:51:39 +00:00
[restoring programs doc](docs/restoring_programs.md).
Optional:
- [restoring vim and neovim sessions](docs/restoring_vim_and_neovim_sessions.md)
- [restoring pane contents](docs/restoring_pane_contents.md)
- [restoring a previously saved environment](docs/restoring_previously_saved_environment.md)
2014-08-27 19:31:10 +00:00
Requirements / dependencies: `tmux 1.9` or higher, `bash`.
2014-08-26 22:11:13 +00:00
2015-10-08 16:30:08 +00:00
Tested and working on Linux, OSX and Cygwin.
2014-09-20 11:23:42 +00:00
`tmux-resurrect` is idempotent! It will not try to restore panes or windows that
already exist.<br/>
The single exception to this is when tmux is started with only 1 pane in order
2015-07-07 00:33:53 +00:00
to restore previous tmux env. Only in this case will this single pane be
overwritten.
2014-11-21 13:47:57 +00:00
2014-08-26 14:07:04 +00:00
### Installation with [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm) (recommended)
Add plugin to the list of TPM plugins in `.tmux.conf`:
2015-07-07 00:31:18 +00:00
set -g @plugin 'tmux-plugins/tmux-resurrect'
2014-08-26 14:07:04 +00:00
Hit `prefix + I` to fetch the plugin and source it. You should now be able to
use the plugin.
### Manual Installation
Clone the repo:
$ git clone https://github.com/tmux-plugins/tmux-resurrect ~/clone/path
2014-08-26 14:07:04 +00:00
Add this line to the bottom of `.tmux.conf`:
run-shell ~/clone/path/resurrect.tmux
2014-08-26 14:07:04 +00:00
2015-07-07 16:03:10 +00:00
Reload TMUX environment with: `$ tmux source-file ~/.tmux.conf`.
2014-08-26 14:07:04 +00:00
You should now be able to use the plugin.
2015-08-10 16:51:39 +00:00
### Docs
2014-10-17 20:40:15 +00:00
- [Guide for migrating from tmuxinator](docs/migrating_from_tmuxinator.md)
2015-08-10 16:51:39 +00:00
**Configuration**
2014-10-17 20:40:15 +00:00
2015-08-10 16:51:39 +00:00
- [Changing the default key bindings](docs/custom_key_bindings.md).
2018-01-19 16:36:13 +00:00
- [Setting up hooks on save & restore](docs/hooks.md).
2015-08-10 16:51:39 +00:00
- Only a conservative list of programs is restored by default:<br/>
2017-10-10 08:12:44 +00:00
`vi vim nvim emacs man less more tail top htop irssi weechat mutt`.<br/>
2015-08-10 16:51:39 +00:00
[Restoring programs doc](docs/restoring_programs.md) explains how to restore
additional programs.
- [Change a directory](docs/save_dir.md) where `tmux-resurrect` saves tmux
environment.
2014-10-17 20:40:15 +00:00
2015-08-10 16:51:39 +00:00
**Optional features**
2015-08-10 16:51:39 +00:00
- [Restoring vim and neovim sessions](docs/restoring_vim_and_neovim_sessions.md)
is nice if you're a vim/neovim user.
- [Restoring pane contents](docs/restoring_pane_contents.md) feature.
### Other goodies
- [tmux-copycat](https://github.com/tmux-plugins/tmux-copycat) - a plugin for
regex searches in tmux and fast match selection
- [tmux-yank](https://github.com/tmux-plugins/tmux-yank) - enables copying
highlighted text to system clipboard
- [tmux-open](https://github.com/tmux-plugins/tmux-open) - a plugin for quickly
opening highlighted file or a url
2015-02-20 13:18:24 +00:00
- [tmux-continuum](https://github.com/tmux-plugins/tmux-continuum) - automatic
restoring and continuous saving of tmux env
2014-08-27 19:31:10 +00:00
### Reporting bugs and contributing
Both contributing and bug reports are welcome. Please check out
[contributing guidelines](CONTRIBUTING.md).
2014-08-27 19:31:10 +00:00
### Credits
2014-08-27 23:09:55 +00:00
[Mislav Marohnić](https://github.com/mislav) - the idea for the plugin came from his
2014-11-21 13:47:57 +00:00
[tmux-session script](https://github.com/mislav/dotfiles/blob/2036b5e03fb430bbcbc340689d63328abaa28876/bin/tmux-session).
2014-08-27 19:31:10 +00:00
2014-08-25 19:52:07 +00:00
### License
[MIT](LICENSE.md)