tmux-plugins / tpm

Tmux Plugin Manager
MIT License
12.21k stars 429 forks source link

Plug-ins not loaded from custom dir when configuration not in default location #123

Closed pet3r closed 6 years ago

pet3r commented 6 years ago

I set the TMUX_PLUGIN_MANAGER_PATH in the config file to load the plugins from a specific dir. This worked fine.

Then I moved the .tmux.conf file to another location and loaded it with tmux -f path/to/.tmux.conf.

Now my plugins wont load.

My .tmux.conf file:

set -g default-terminal 'xterm-256color'
set -g status on
set -g mouse on
set -g set-titles on
set-window-option -g automatic-rename on
set-window-option -g monitor-activity on
set -g base-index 1
set-window-option -g mode-keys vi
set -g status-interval 2
set -g status-right '#{prefix_highlight} #[fg=green]#(tmux-mem-cpu-load --colors --interval 2 --mem-mode 2 --averages-count 0 --graph-lines 0)#[default] | #{=21:pane_title} | %a %m-%d %H:%M'
set -g status-right-length 90

##  Plugins

set-environment -g TMUX_PLUGIN_MANAGER_PATH "$XDG_CACHE_HOME/tmux/plugins/"

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'

# Conflicts with byobu, consult with README
# set -g @plugin 'thewtex/tmux-mem-cpu-load'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

# auto install Tmux Plugin Manager and the plugins
if "test ! -d $XDG_CACHE_HOME/tmux/plugins/tpm" \
   "run 'git clone https://github.com/tmux-plugins/tpm $XDG_CACHE_HOME/tmux/plugins/tpm && $XDG_CACHE_HOME/tmux/plugins/tpm/bin/install_plugins'"

bind-key C-c run-shell "tmux show-buffer | xclip -i"
#bind-key C-v run-shell "tmux set-buffer \\"$(xclip -o)\\"; tmux paste-buffer"
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind T swap-window -t 1
bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display-message "Config reloaded..."

run '$XDG_CACHE_HOME/tmux/plugins/tpm/tpm'
yxliang01 commented 6 years ago

Possibly duplicate of https://github.com/tmux-plugins/tpm/issues/57 ?

danemacmillan commented 5 years ago

@pet3r Just to be persnickety, it would be more correct to use the $XDG_DATA_HOME directory to store the plugins. The plugins are not cache data. Have a look at how other XDG-compliant utilities leverage that directory. Cache data is by its nature ephemeral or "non-essential," which implies a possibly limited lifetime. In that sense, you wouldn't want your plugins to disappear randomly.