Move all docs to 'docs/' dir

This commit is contained in:
Bruno Sutic 2015-08-10 18:51:39 +02:00
parent e81f8e5f37
commit 4d5c30c29a
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
7 changed files with 108 additions and 81 deletions

105
README.md
View File

@ -14,7 +14,8 @@ projects.
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.
It even (optionally) [restores vim and neovim sessions](#restoring-vim-and-neovim-sessions)!
It even (optionally)
[restores vim and neovim sessions](docs/restoring_vim_and_neovim_sessions.md)!
Automatic restoring and continuous saving of tmux env is also possible with
[tmux-continuum](https://github.com/tmux-plugins/tmux-continuum) plugin.
@ -28,11 +29,6 @@ Automatic restoring and continuous saving of tmux env is also possible with
- `prefix + Ctrl-s` - save
- `prefix + Ctrl-r` - restore
For custom key bindings, add to `.tmux.conf`:
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
### About
This plugin goes to great lengths to save and restore all the details from your
@ -47,13 +43,13 @@ This plugin goes to great lengths to save and restore all the details from your
- active pane for each window
- "grouped sessions" (useful feature when using tmux with multiple monitors)
- programs running within a pane! More details in the
[configuration section](#configuration).
- restoring vim/neovim sessions (optional). More details in
[restoring vim and neovim sessions](#restoring-vim-and-neovim-sessions).
- restoring bash history (optional, \*experimental*). More details in
[restoring bash history](#restoring-bash-history-experimental).
- restoring tmux pane contents (optional, \*experimental*). More details in
[restoring pane contents](#restoring-pane-contents-experimental).
[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 bash history](docs/restoring_bash_history.md) (experimental)
Requirements / dependencies: `tmux 1.9` or higher, `bash`.
@ -85,80 +81,27 @@ Add this line to the bottom of `.tmux.conf`:
Reload TMUX environment with: `$ tmux source-file ~/.tmux.conf`.
You should now be able to use the plugin.
### Configuration
### Docs
Configuration is not required, but it enables extra features.
**Configuration**
Only a conservative list of programs is restored by default:<br/>
`vi vim nvim emacs man less more tail top htop irssi`.
- [Changing the default key bindings](docs/custom_key_bindings.md).
- Only a conservative list of programs is restored by default:<br/>
`vi vim nvim emacs man less more tail top htop irssi`.<br/>
[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.
- Restore additional programs with the setting in `.tmux.conf`:
**Optional features**
set -g @resurrect-processes 'ssh psql mysql sqlite3'
- [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.
- Programs with arguments should be double quoted:
**Experimental features (also optional)**
set -g @resurrect-processes 'some_program "git log"'
- Start with tilde to restore a program whose process contains target name:
set -g @resurrect-processes 'irb pry "~rails server" "~rails console"'
- Use `->` to specify a command to be used when restoring a program (useful if
the default restore command fails ):
set -g @resurrect-processes 'some_program "grunt->grunt development"'
- Don't restore any programs:
set -g @resurrect-processes 'false'
- Restore **all** programs (be careful with this!):
set -g @resurrect-processes ':all:'
#### Restoring vim and neovim sessions
- save vim/neovim sessions. I recommend
[tpope/vim-obsession](https://github.com/tpope/vim-obsession) (as almost every
plugin, it works for both vim and neovim).
- in `.tmux.conf`:
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
`tmux-resurrect` will now restore vim and neovim sessions if `Sessions.vim` file
is present.
#### Resurrect save dir
By default Tmux environment is saved to a file in `~/.tmux/resurrect` dir.
Change this with:
set -g @resurrect-dir '/some/path'
#### Restoring bash history (experimental)
In `.tmux.conf`:
set -g @resurrect-save-bash-history 'on'
Bash `history` for individual panes will now be saved and restored. Due to
technical limitations, this only works for panes which have no program running in
foreground when saving. `tmux-resurrect` will send history write command
to each such pane. To prevent these commands from being added to history themselves,
add `HISTCONTROL=ignoreboth` to your `.bashrc` (this is set by default in Ubuntu).
#### Restoring pane contents (experimental)
To enable saving and restoring tmux pane contents add this line to `.tmux.conf`:
set -g @resurrect-capture-pane-contents 'on'
This feature works fine, but there may be some glitches as we're
[actively working on this](https://github.com/tmux-plugins/tmux-resurrect/issues/81).
- [restoring bash history](docs/restoring_bash_history.md)
### Other goodies

View File

@ -0,0 +1,11 @@
# Custom key bindings
The default key bindings are:
- `prefix + Ctrl-s` - save
- `prefix + Ctrl-r` - restore
To change these, add to `.tmux.conf`:
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'

View File

@ -0,0 +1,12 @@
# Restoring bash history (experimental)
Enable feature with this option in `.tmux.conf`:
set -g @resurrect-save-bash-history 'on'
Bash `history` for individual panes will now be saved and restored. Due to
technical limitations, this only works for panes which have no program running
in foreground when saving. `tmux-resurrect` will send history write command to
each such pane. To prevent these commands from being added to history
themselves, add `HISTCONTROL=ignoreboth` to your `.bashrc`
(this is set by default in Ubuntu).

View File

@ -0,0 +1,7 @@
# Restoring pane contents
This plugin enables saving and restoring tmux pane contents.
This feature can be enabled by adding this line to `.tmux.conf`:
set -g @resurrect-capture-pane-contents 'on'

View File

@ -0,0 +1,33 @@
# Restoring programs
Only a conservative list of programs is restored by default:<br/>
`vi vim nvim emacs man less more tail top htop irssi`.
This can be configured with `@resurrect-processes` option in `.tmux.conf`. It
contains space-separated list of additional programs to restore.
- Example restoring additional programs:
set -g @resurrect-processes 'ssh psql mysql sqlite3'
- Programs with arguments should be double quoted:
set -g @resurrect-processes 'some_program "git log"'
- Start with tilde to restore a program whose process contains target name:
set -g @resurrect-processes 'irb pry "~rails server" "~rails console"'
- Use `->` to specify a command to be used when restoring a program (useful if
the default restore command fails ):
set -g @resurrect-processes 'some_program "grunt->grunt development"'
- Don't restore any programs:
set -g @resurrect-processes 'false'
- Restore **all** programs (be careful with this!):
set -g @resurrect-processes ':all:'

View File

@ -0,0 +1,15 @@
# Restoring vim and neovim sessions
- save vim/neovim sessions. I recommend
[tpope/vim-obsession](https://github.com/tpope/vim-obsession) (as almost every
plugin, it works for both vim and neovim).
- in `.tmux.conf`:
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
`tmux-resurrect` will now restore vim and neovim sessions if `Sessions.vim` file
is present.

6
docs/save_dir.md Normal file
View File

@ -0,0 +1,6 @@
# Resurrect save dir
By default Tmux environment is saved to a file in `~/.tmux/resurrect` dir.
Change this with:
set -g @resurrect-dir '/some/path'