Automatic set enviroment

This commit is contained in:
Krakakanok 2016-02-03 03:22:54 +01:00
parent 51ff07a729
commit 1ff3120819
2 changed files with 2 additions and 16 deletions

View File

@ -10,4 +10,3 @@ default_clean_key="M-u"
SUPPORTED_TMUX_VERSION="1.9" SUPPORTED_TMUX_VERSION="1.9"
DEFAULT_TPM_ENV_VAR_NAME="TMUX_PLUGIN_MANAGER_PATH" DEFAULT_TPM_ENV_VAR_NAME="TMUX_PLUGIN_MANAGER_PATH"
DEFAULT_TPM_PATH="$HOME/.tmux/plugins/"

17
tpm
View File

@ -17,22 +17,9 @@ get_tmux_option() {
fi fi
} }
tpm_path_set() { # Set TMUX_PLUGIN_MANAGER_PATH global env variable.
tmux show-environment -g "$DEFAULT_TPM_ENV_VAR_NAME" >/dev/null 2>&1
}
set_default_tpm_path() {
tmux set-environment -g "$DEFAULT_TPM_ENV_VAR_NAME" "$DEFAULT_TPM_PATH"
}
# Ensures TMUX_PLUGIN_MANAGER_PATH global env variable is set.
#
# Put this in `.tmux.conf` to override the default:
# `set-environment -g TMUX_PLUGIN_MANAGER_PATH "/some/other/path/"`
set_tpm_path() { set_tpm_path() {
if ! tpm_path_set; then tmux set-environment -g "$DEFAULT_TPM_ENV_VAR_NAME" "$CURRENT_DIR/../"
set_default_tpm_path
fi
} }
# 1. Fetches plugin names from `@plugin` variables # 1. Fetches plugin names from `@plugin` variables