In this post, I want to share how to manage tmux plugins with Tmux plugin manager (i.e., tpm) and also mention a few useful plugins.
Like Vim, to add new tmux plugins, we can either manually install them or employ a plugin manager. Tpm is designed for this purpose, which helps to manage our plugins automatically.
First, we need to install tpm itself:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpmAdd the following setting to your tmux configuration file .tmux.conf:
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# .... maybe more plugins here
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'Then you should refresh the tmux environment to make the change take effect:
tmux source ~/.tmux.confThe following operations assume that you are in a tmux session.
Add new plugin to ~/.tmux.conf with set -g @plugin '...'
Press <prefix> + I1 (capital I) to fetch the plugin.
Press <prefix> + U to update existing plugins
Delete or comment out the plugin line in .tmux.conf
Press <prefix> + alt + u to remove the plugin
According to doc here,
to automatically install tpm on a new machine, you can add the following
setting to your .tmux.conf:
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"Themes are great. Here are a few themes you can try.
Tmux theme pack is a collection of themes.
Install it with tpm (add the following setting to .tmux.conf):
set -g @plugin 'jimeh/tmux-themepack'Pick a theme:
set -g @themepack 'powerline/block/cyan'tmux-colors-solarized is a solarized color theme for tmux.
Install it with tpm:
set -g @plugin 'seebi/tmux-colors-solarized'Four themes are provided: 256, dark, light and base16. You can choose
one via .tmux.conf option:
set -g @colors-solarized '256'
# set -g @colors-solarized 'dark'
# set -g @colors-solarized 'light'
# set -g @colors-solarized 'base16'Tmux-resurrect let you easily restore all your tmux session after a system restart so that you do not need to do it manually.
Install it with tpm:
set -g @plugin 'tmux-plugins/tmux-resurrect'It provides two key bindings for save and restore your tmux environment:
<prefix> + Ctrl-s<prefix> + Ctrl-rFor more plugins, you can find them here and here.
<prefix> is your prefix key for tmux ↩︎
In this post, I want to share how to manage tmux plugins with Tmux plugin manager (i.e., tpm) and also mention a few useful plugins.
Like Vim, to add new tmux plugins, we can either manually install them or employ a plugin manager. Tpm is designed for this purpose, which helps to manage our plugins automatically.
First, we need to install tpm itself:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpmAdd the following setting to your tmux configuration file .tmux.conf:
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# .... maybe more plugins here
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'Then you should refresh the tmux environment to make the change take effect:
tmux source ~/.tmux.confThe following operations assume that you are in a tmux session.
Add new plugin to ~/.tmux.conf with set -g @plugin '...'
Press <prefix> + I1 (capital I) to fetch the plugin.
Press <prefix> + U to update existing plugins
Delete or comment out the plugin line in .tmux.conf
Press <prefix> + alt + u to remove the plugin
According to doc here,
to automatically install tpm on a new machine, you can add the following
setting to your .tmux.conf:
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"Themes are great. Here are a few themes you can try.
Tmux theme pack is a collection of themes.
Install it with tpm (add the following setting to .tmux.conf):
set -g @plugin 'jimeh/tmux-themepack'Pick a theme:
set -g @themepack 'powerline/block/cyan'tmux-colors-solarized is a solarized color theme for tmux.
Install it with tpm:
set -g @plugin 'seebi/tmux-colors-solarized'Four themes are provided: 256, dark, light and base16. You can choose
one via .tmux.conf option:
set -g @colors-solarized '256'
# set -g @colors-solarized 'dark'
# set -g @colors-solarized 'light'
# set -g @colors-solarized 'base16'Tmux-resurrect let you easily restore all your tmux session after a system restart so that you do not need to do it manually.
Install it with tpm:
set -g @plugin 'tmux-plugins/tmux-resurrect'It provides two key bindings for save and restore your tmux environment:
<prefix> + Ctrl-s<prefix> + Ctrl-rFor more plugins, you can find them here and here.
<prefix> is your prefix key for tmux ↩︎