dotfiles/.config/shell/zshrc.d/5-install-tmux-plugin-manager.zsh

21 lines
527 B
Bash
Raw Normal View History

2019-07-24 05:33:28 +00:00
#!/bin/zsh
#
2019-02-04 14:27:49 +00:00
# Clone tmux plugin manager if not existing
if [[ -z "$TPM_PARENT_DIR" ]]; then
2019-03-12 14:47:07 +00:00
TPM_PARENT_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/tmux
2019-02-04 14:27:49 +00:00
fi
2019-02-24 23:38:18 +00:00
if [[ ! -f $TPM_PARENT_DIR/plugins/tpm/tpm ]]; then
2019-02-04 14:27:49 +00:00
if [[ ! -d "$TPM_PARENT_DIR" ]]; then
mkdir -p "$TPM_PARENT_DIR"
fi
2019-07-24 05:33:28 +00:00
cd "$TPM_PARENT_DIR" || exit
2019-02-24 23:38:18 +00:00
git clone https://github.com/tmux-plugins/tpm plugins/tpm
2019-02-04 14:27:49 +00:00
fi
2019-02-24 23:38:18 +00:00
export TMUX_PLUGIN_MANAGER_PATH=$TPM_PARENT_DIR/plugins
2019-07-24 05:33:28 +00:00
alias tmux="tmux -f "'"${TPM_PARENT_DIR}"'"/tmux.conf"
2019-02-24 23:38:18 +00:00
2019-02-04 14:27:49 +00:00
unset TPM_PARENT_DIR
2019-02-24 23:38:18 +00:00
unset TPM_SUB_DIR