tmux-plugins / tpm

Tmux Plugin Manager
MIT License
11.68k stars 415 forks source link

Is there a way to install plugins to another directory? #264

Closed LittleNewton closed 9 months ago

LittleNewton commented 9 months ago

Hi,

I am using tpm now and it works nice.

For the reason of management, I need to put all the plugins in ~/.config/tmux/plugins. Is there a method to realize it?

Freed-Wu commented 9 months ago

I need to put all the plugins in ~/.config/tmux/plugins. Is there a method to realize it?

Currently, tpm install all my plugins to ~/.config/tmux/plugins. Is it because you use a old tpm?

LittleNewton commented 9 months ago
$ ls .tmux/plugins/
rainbarf/        tmux-continuum/  tmux-fzf/        tmux-powerline/  tmux-resurrect/  tpm/

It looks like that all plugins are installed in ~/.tmux/plugins.

Freed-Wu commented 9 months ago
    local xdg_tmux_path="${XDG_CONFIG_HOME:-$HOME/.config}/tmux"
    local tpm_path="$DEFAULT_TPM_PATH"

    if [ -f "$xdg_tmux_path/tmux.conf" ]; then
        tpm_path="$xdg_tmux_path/plugins/"
    fi

Can you change ~/.config/tmux/tmux.conf?

LittleNewton commented 9 months ago

I am wondering to know how to change the default path of tmux's configs.

~/.config/tmux/tmux.conf exists, but it doesn't work.

Only contents in ~/.tmux.conf will influence tmux.

LittleNewton commented 9 months ago

tmux version: tmux 3.3a OS: Debian 12 bookworm

LittleNewton commented 9 months ago

OK, I have found the solution.

  1. If you are using zsh as me, you can export XDG_CONFIG_HOME=~/.config
  2. touch ~/.config/tmux/tmux.conf and paste all your configurations into it.
  3. At the end of ~/.config/tmux/tmux.conf, remember to add a line with content: run '~/.config/tmux/plugins/tpm/tpm'.
  4. clone tmp to /home/newton/.config/tmux/plugins/tpm
  5. Just enjoy it.
Freed-Wu commented 9 months ago

OK.can you close this issue because the problem has been solved?