1
0
Fork 0
mirror of synced 2024-06-12 20:11:11 -04:00
tpm/tpm

36 lines
1,008 B
Plaintext
Raw Normal View History

2014-05-18 18:35:55 -04:00
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# 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() {
2014-05-24 17:15:13 -04:00
$CURRENT_DIR/scripts/set_tpm_path.sh >/dev/null 2>&1
2014-05-18 18:35:55 -04:00
}
# 1. Fetches plugin names from `@tpm_plugins` user variable.
# 2. Creates full plugin path
# 3. Sources all *.tmux files from each of the plugin directories
2014-05-24 17:15:13 -04:00
# - no errors raised if directory does not exist
2014-05-18 18:35:55 -04:00
# Files are sourced as tmux config files, not as shell scripts!
source_plugins() {
2014-05-24 17:15:13 -04:00
$CURRENT_DIR/scripts/source_plugins.sh >/dev/null 2>&1
2014-05-18 18:35:55 -04:00
}
# Defines key binding:
# prefix + I - downloads TPM plugins and reloads TMUX environment.
set_tpm_key_binding() {
2014-05-24 17:15:13 -04:00
$CURRENT_DIR/scripts/key_binding.sh
2014-05-18 18:35:55 -04:00
}
main() {
2014-05-24 17:15:13 -04:00
set_tpm_path
set_tpm_key_binding
source_plugins
2014-05-18 18:35:55 -04:00
}
main