mirror of
https://github.com/tmux-plugins/tpm.git
synced 2024-10-31 23:28:47 +00:00
Automatic set enviroment
This commit is contained in:
parent
51ff07a729
commit
1ff3120819
@ -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
17
tpm
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user