1
0
Fork 0
mirror of synced 2024-11-17 23:15:35 -05:00

added support for configuration files in the following locations: (2), fixes #630

- ~/.tmux.conf and ~/.tmux.conf.local
- $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local
- ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local

fixed TMUX_PLUGIN_MANAGER_PATH when installed in ~

also made TMUX_PLUGIN_MANAGER_PATH available in the environment of the first created pane
This commit is contained in:
Gregory Pakosz 2023-03-06 09:14:34 +01:00
parent 9941420c6d
commit 96b36d4bbe

View file

@ -1426,7 +1426,9 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# tmux_conf_update_plugins_on_reload="$3"
# tmux_conf_uninstall_plugins_on_reload="$4"
#
# TMUX_PLUGIN_MANAGER_PATH=${TMUX_PLUGIN_MANAGER_PATH:-$(dirname "$TMUX_CONF")/plugins}
# if [ -z "$TMUX_PLUGIN_MANAGER_PATH" ]; then
# return 255
# fi
# mkdir -p "$TMUX_PLUGIN_MANAGER_PATH"
#
# tpm_plugins=$(tmux show -gvq '@tpm_plugins' 2>/dev/null)
@ -1459,7 +1461,6 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# ;s/(install_plugin(.(?!&))*)\n(\s+)done/\1&\n\3done\n\3wait/g' "$TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/install_plugins.sh"
# perl -p -i -e 's/git submodule update --init --recursive(?!\s+--depth\s+1)/git submodule update --init --recursive --depth 1/g' "$TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/update_plugin.sh"
# perl -p -i -e 's,\$tmux_file\s+>/dev/null\s+2>\&1,$& || { tmux display "Plugin \$(basename \${plugin_path}) failed" && false; },' "$TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/source_plugins.sh"
# tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGIN_MANAGER_PATH"
# fi
# if [ "$update_tpm" = "true" ]; then
# {
@ -1502,7 +1503,19 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# tmux_conf_update_plugins_on_launch=${tmux_conf_update_plugins_on_launch:-true}
# tmux_conf_update_plugins_on_reload=${tmux_conf_update_plugins_on_reload:-true}
# tmux_conf_uninstall_plugins_on_reload=${tmux_conf_uninstall_plugins_on_reload:-true}
# tmux run -b "cut -c3- '$TMUX_CONF' | sh -s __apply_plugins '$window_active' '$tmux_conf_update_plugins_on_launch' '$tmux_conf_update_plugins_on_reload' '$tmux_conf_uninstall_plugins_on_reload'"
#
# tpm_plugins=$(tmux show -gvq '@tpm_plugins' 2>/dev/null)
# if [ -n "$(tmux show -gv '@plugin' 2>/dev/null)" ] || [ -n "$tpm_plugins" ]; then
# if [ -z "$TMUX_PLUGIN_MANAGER_PATH" ]; then
# if [ "$(dirname "$TMUX_CONF")" = "$HOME" ]; then
# TMUX_PLUGIN_MANAGER_PATH="$HOME/.tmux/plugins"
# else
# TMUX_PLUGIN_MANAGER_PATH="$(dirname "$TMUX_CONF")/plugins"
# fi
# tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGIN_MANAGER_PATH"
# fi
# tmux run -b "cut -c3- '$TMUX_CONF' | sh -s __apply_plugins '$window_active' '$tmux_conf_update_plugins_on_launch' '$tmux_conf_update_plugins_on_reload' '$tmux_conf_uninstall_plugins_on_reload'"
# fi
# }
#
# _apply_important() {