Tmux Plugin Manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB

#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/scripts/"
source "$CURRENT_DIR/scripts/"
# Ensures TMUX_PLUGIN_MANAGER_PATH global env variable is set.
# Default tpm path is "$HOME/.tmux/plugins/". That's where all the plugins are
# downloaded.
# Put this in `.tmux.conf` to override the default:
# `set-environment -g TMUX_PLUGIN_MANAGER_PATH "/some/other/path/"`
set_tpm_path() {
$CURRENT_DIR/scripts/ >/dev/null 2>&1
# 1. Fetches plugin names from `@plugin` variables
# 2. Creates full plugin path
# 3. Sources all *.tmux files from each of the plugin directories
# - no errors raised if directory does not exist
# Files are sourced as tmux config files, not as shell scripts!
source_plugins() {
$CURRENT_DIR/scripts/ >/dev/null 2>&1
# prefix + I - downloads TPM plugins and reloads TMUX environment
# 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() {
local install_key=$(get_tmux_option "$install_key_option" "$default_install_key")
tmux bind-key "$install_key" run-shell "$CURRENT_DIR/scripts/ >/dev/null 2>&1"
local update_key=$(get_tmux_option "$update_key_option" "$default_update_key")
tmux bind-key "$update_key" run-shell "$CURRENT_DIR/scripts/"
local clean_key=$(get_tmux_option "$clean_key_option" "$default_clean_key")
tmux bind-key "$clean_key" run-shell "$CURRENT_DIR/scripts/"
supported_tmux_version_ok() {
main() {
if supported_tmux_version_ok; then