mirror of
1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Łukasz Siemiradzki 4e3a656e16
Merge 6fc9ad1c9d into 1469d465f8 2024-01-17 19:13:37 +00:00
Gregory Pakosz 1469d465f8 added support for defining TPM plugins with 'set -g @tpm_plugins', resolves #706 2024-01-17 19:22:00 +01:00
Łukasz SIEMIRADZKI 6fc9ad1c9d Don't use C-a as a prefix, keep C-b as the only prefix. 2023-11-15 12:10:39 +01:00
2 changed files with 23 additions and 16 deletions

View File

@ -1469,10 +1469,11 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# }
#
# __apply_plugins() {
# window_active="$1"
# tmux_conf_update_plugins_on_launch="$2"
# tmux_conf_update_plugins_on_reload="$3"
# tmux_conf_uninstall_plugins_on_reload="$4"
# TMUX_PLUGIN_MANAGER_PATH="$1"
# window_active="$2"
# tmux_conf_update_plugins_on_launch="$3"
# tmux_conf_update_plugins_on_reload="$4"
# tmux_conf_uninstall_plugins_on_reload="$5"
#
# if [ -z "$TMUX_PLUGIN_MANAGER_PATH" ]; then
# return 255
@ -1483,15 +1484,18 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# if [ -z "$(tmux show -gv '@plugin' 2>/dev/null)" ] && [ -z "$tpm_plugins" ]; then
# if _is_true "$tmux_conf_uninstall_plugins_on_reload" && [ -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
# tmux display 'Uninstalling tpm and plugins...'
# tmux set-environment -gu TMUX_PLUGIN_MANAGER_PATH
# rm -rf "$TMUX_PLUGIN_MANAGER_PATH"
# tmux display 'Done uninstalling tpm and plugins...'
# fi
# else
# if [ "$(command tmux display -p '#{pid} #{version} #{socket_path}')" = "$($TMUX_PROGRAM display -p '#{pid} #{version} #{socket_path}')" ]; then
# tpm_plugins=$(cat << EOF | tr ' ' '\n' | awk '/^\s*$/ {next;}; !seen[$0]++ { gsub(/^[ \t]+/,"",$0); gsub(/[ \t]+$/,"",$0); print $0 }'
# "$tpm_plugins"
# $(awk '/^[ \t]*set(-option)?.*[ \t]@plugin[ \t]/ { gsub(/'\''/, ""); gsub(/'\"'/, ""); print $NF }' "$TMUX_CONF_LOCAL" 2>/dev/null)
# EOF
# )
# tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGIN_MANAGER_PATH"
# tmux set -g '@tpm_plugins' "$tpm_plugins"
# if git ls-remote -hq https://github.com/gpakosz/.tmux.git master > /dev/null; then
# if [ ! -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
@ -1539,9 +1543,9 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# fi
#
# if [ "$_tmux_version" -gt 260 ]; then
# tmux set -gu '@tpm-install' \; set -gu '@tpm-update' \; set -gu '@tpm-clean' \; set -gu '@plugin'
# tmux set -gu '@tpm-install' \; set -gu '@tpm-update' \; set -gu '@tpm-clean' \; set -gu '@plugin' \; set -gu '@tpm_plugins'
# else
# tmux set -g '@tpm-install' '' \; set -g '@tpm-update' '' \; set -g '@tpm-clean' '' \; set -g '@plugin' ''
# tmux set -g '@tpm-install' '' \; set -g '@tpm-update' '' \; set -g '@tpm-clean' '' \; set -g '@plugin' '' \; set-gu '@tpm_plugins' ''
# fi
# fi
# }
@ -1551,18 +1555,14 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# 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}
#
# 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"
# 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 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
# tmux run -b "cut -c3- '$TMUX_CONF' | sh -s __apply_plugins '$TMUX_PLUGIN_MANAGER_PATH' '$window_active' '$tmux_conf_update_plugins_on_launch' '$tmux_conf_update_plugins_on_reload' '$tmux_conf_uninstall_plugins_on_reload'"
# }
#
# _apply_important() {

View File

@ -370,6 +370,10 @@ tmux_conf_copy_to_os_clipboard=false
# set -g prefix C-a
# bind C-a send-prefix
# don't use C-a as a prefix, keep C-b as the only prefix
# set -gu prefix2
# unbind C-a
# if you don't want Oh my tmux! to alter a binding, use #!important
# bind c new-window -c '#{pane_current_path}' #!important
@ -429,6 +433,8 @@ tmux_conf_uninstall_plugins_on_reload=true
# then, use #{foo} in e.g. the 'tmux_conf_theme_status_left' or the
# 'tmux_conf_theme_status_right' variables.
# ------------------------------------------------------------------------------
# # /!\ do not remove the following line
# EOF
#
@ -445,3 +451,4 @@ tmux_conf_uninstall_plugins_on_reload=true
#
# "$@"
# # /!\ do not remove the previous line
# # do not write below this line