Skip to content

Commit

Permalink
added support for configuration files in the following locations: (2),
Browse files Browse the repository at this point in the history
…fixes gpakosz#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
  • Loading branch information
gpakosz committed Mar 6, 2023
1 parent 9941420 commit 96b36d4
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
# {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 96b36d4

Please sign in to comment.