1
0
mirror of https://github.com/samoshkin/tmux-config.git synced 2026-01-03 16:28:01 +00:00

Fix installation script so it can install tmux plugin manager and tmux plugins

This commit is contained in:
Alexey Samoshkin
2017-11-24 15:19:24 +02:00
parent 21a9125689
commit 9c6d5f7e1c

View File

@@ -18,8 +18,8 @@ fi
if [ ! -e "$HOME/.tmux/plugins/tpm" ]; then
printf "$(tput setaf 1)WARNING:$(tput sgr0) Cannot found TPM (Tmux Plugin Manager) \
at default location: \$HOME/.tmux/plugins/tpm. Install it first\n"
exit 1
at default location: \$HOME/.tmux/plugins/tpm.\n"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
if [ -e "$HOME/.tmux.conf" ]; then
@@ -30,8 +30,13 @@ rsync -aq ./tmux/ "$HOME"/.tmux
ln -sf --backup --suffix=.bak .tmux/tmux.conf "$HOME"/.tmux.conf;
# BUG: Fix TPM and tmux plugins for fresh installation
# "$HOME"/.tmux/plugins/tpm/bin/install_plugins
# Install TPM plugins.
# TPM requires running tmux server, as soon as `tmux start-server` does not work
# create dump __noop session in detached mode, and kill it when plugins are installed
tmux new -d -s __noop >/dev/null 2>&1 || true
tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.tmux/plugins"
"$HOME"/.tmux/plugins/tpm/bin/install_plugins || true
tmux kill-session -t __noop >/dev/null 2>&1 || true
printf "$(tput setaf 2)OK:$(tput sgr0) Completed\n"
@@ -45,4 +50,3 @@ printf "$(tput setaf 2)OK:$(tput sgr0) Completed\n"