File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Changing plugins install dir
2
2
3
- By default, TPM installs plugins to ` ~/.tmux/plugins/ ` .
3
+ By default, TPM installs plugins in a subfolder named ` plugins/ ` inside
4
+ ` $XDG_CONFIG_HOME/tmux/ ` if a ` tmux.conf ` file was found at that location, or
5
+ inside ` ~/.tmux/ ` otherwise.
4
6
5
7
You can change the install path by putting this in ` .tmux.conf ` :
6
8
Original file line number Diff line number Diff line change @@ -21,8 +21,17 @@ tpm_path_set() {
21
21
tmux show-environment -g " $DEFAULT_TPM_ENV_VAR_NAME " > /dev/null 2>&1
22
22
}
23
23
24
+ # Check if configuration file exists at an XDG-compatible location, if so use
25
+ # that directory for TMUX_PLUGIN_MANAGER_PATH. Otherwise use $DEFAULT_TPM_PATH.
24
26
set_default_tpm_path () {
25
- tmux set-environment -g " $DEFAULT_TPM_ENV_VAR_NAME " " $DEFAULT_TPM_PATH "
27
+ local xdg_tmux_path=" ${XDG_CONFIG_HOME:- $HOME / .config} /tmux"
28
+ local tpm_path=" $DEFAULT_TPM_PATH "
29
+
30
+ if [ -f " $xdg_tmux_path /tmux.conf" ]; then
31
+ tpm_path=" $xdg_tmux_path /plugins/"
32
+ fi
33
+
34
+ tmux set-environment -g " $DEFAULT_TPM_ENV_VAR_NAME " " $tpm_path "
26
35
}
27
36
28
37
# Ensures TMUX_PLUGIN_MANAGER_PATH global env variable is set.
You can’t perform that action at this time.
0 commit comments