relax condition for XDG-compatible plugin path

Instead of checking for the existence of the file
`$XDG_CONFIG_HOME/tmux/tmux.conf`, we only check for the existence
of the directory `$XDG_CONFIG_HOME/tmux`.
This commit is contained in:
Andrey Kaipov 2021-03-11 15:28:28 -05:00
parent 29c871e810
commit fa7655977e
2 changed files with 3 additions and 3 deletions

View File

@ -1,8 +1,8 @@
# Changing plugins install dir
By default, TPM installs plugins in a subfolder named `plugins/` inside
`$XDG_CONFIG_HOME/tmux/` if a `tmux.conf` file was found at that location, or
inside `~/.tmux/` otherwise.
`$XDG_CONFIG_HOME/tmux/` if that directory exists, or inside `~/.tmux/`
otherwise.
You can change the install path by putting this in `.tmux.conf`:

2
tpm
View File

@ -27,7 +27,7 @@ set_default_tpm_path() {
local xdg_tmux_path="${XDG_CONFIG_HOME:-$HOME/.config}/tmux"
local tpm_path="$DEFAULT_TPM_PATH"
if [ -f "$xdg_tmux_path/tmux.conf" ]; then
if [ -d "$xdg_tmux_path" ]; then
tpm_path="$xdg_tmux_path/plugins/"
fi