Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape bindings dir #269

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions scripts/source_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ plugin_dir_exists() {
# No errors if the plugin dir does not exist.
silently_source_all_tmux_files() {
local plugin_path="$1"
local plugin_tmux_files="$plugin_path*.tmux"
if plugin_dir_exists "$plugin_path"; then
for tmux_file in $plugin_tmux_files; do
for tmux_file in "$plugin_path"/*.tmux; do
# if the glob didn't find any files this will be the
# unexpanded glob which obviously doesn't exist
[ -f "$tmux_file" ] || continue
# runs *.tmux file as an executable
$tmux_file >/dev/null 2>&1
"$tmux_file" >/dev/null 2>&1
done
fi
}
Expand Down
8 changes: 5 additions & 3 deletions tpm
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ source_plugins() {
# prefix + U - updates a plugin (or all of them) and reloads TMUX environment
# prefix + alt + u - remove unused TPM plugins and reloads TMUX environment
set_tpm_key_bindings() {
tmux set-environment -g TPM_BINDINGS_DIR "$BINDINGS_DIR"

local install_key="$(get_tmux_option "$install_key_option" "$default_install_key")"
tmux bind-key "$install_key" run-shell "$BINDINGS_DIR/install_plugins"
tmux bind-key "$install_key" run-shell "#{q:TPM_BINDINGS_DIR}/install_plugins"

local update_key="$(get_tmux_option "$update_key_option" "$default_update_key")"
tmux bind-key "$update_key" run-shell "$BINDINGS_DIR/update_plugins"
tmux bind-key "$update_key" run-shell "#{q:TPM_BINDINGS_DIR}/update_plugins"

local clean_key="$(get_tmux_option "$clean_key_option" "$default_clean_key")"
tmux bind-key "$clean_key" run-shell "$BINDINGS_DIR/clean_plugins"
tmux bind-key "$clean_key" run-shell "#{q:TPM_BINDINGS_DIR}/clean_plugins"
}

supported_tmux_version_ok() {
Expand Down