You've created a tmux session and worked with it. You've created a pane layout that works for you, and started your Vim editor.

What happens when you shut down your computer, and start it again later?

Tmux doesn't remember your sessions. When you restart tmux, you loose all your running programs, etc.

There are two tmux plugins that can help with that: Tmux Resurrect and tmux-continuum.

Installation with Tmux Plugin Manager

Add theses lines to the list of plugins inside tmux.conf:

set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

Extra Features

You can add some extra functionality to tmux.conf:

# Restore Vim sessions
set -g @resurrect-strategy-vim 'session'
# Restore Neovim sessions
set -g @resurrect-strategy-nvim 'session'
# Restore Panes
set -g @resurrect-capture-pane-contents 'on'
# Restore last saved environment (automatically)
set -g @continuum-restore 'on'

Start tmux Automatically on Boot


Add this line to tmux.conf:

set -g @continuum-boot 'on'

You can find more information about this feature on GitHub.


The script only works with systemd.

Add this line to tmux.conf:

set -g @continuum-boot 'on'

Exit tmux, and reload with tmux source-file ~/.tmux.conf.

You'll find a new service file under ~/.config/systemd/user/tmux.service.

Description=tmux default session (detached)

ExecStart=/usr/bin/tmux new-session -d

ExecStop=/usr/bin/tmux kill-server



Copy the file to etc/systemd/system. You'll need sudo for that.

sudo cp ~/.config/systemd/user/tmux.service /etc/systemd/system/

Enable the service:

sudo systemctl enable tmux --now