diff --git a/tmux.conf b/tmux.conf index 6eca7a5..7f7584c 100644 --- a/tmux.conf +++ b/tmux.conf @@ -49,6 +49,12 @@ bind -N "emit F9 key press with prefix-F9 (because we have bound F9 to anothe ############### [ Plugins ] ############### +# Syntax: +# set -g @plugin 'github_username/plugin_name' +# set -g @plugin 'github_username/plugin_name#branch' +# set -g @plugin 'git@github.com:user/plugin' +# set -g @plugin 'git@bitbucket.com:user/plugin' + # List of plugins to install set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' @@ -58,14 +64,11 @@ set -g @plugin 'tmux-plugins/tmux-copycat' set -g @plugin 'erikw/tmux-powerline' set -g @plugin "nordtheme/tmux" -# Other examples: -# set -g @plugin 'github_username/plugin_name' -# set -g @plugin 'github_username/plugin_name#branch' -# set -g @plugin 'git@github.com:user/plugin' -# set -g @plugin 'git@bitbucket.com:user/plugin' - -# Automatically install tpm -if "test ! -d ~/.tmux/plugins/tpm" "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -run "${HOME}/.config/tmux/plugins/tpm/tpm" +# Initialize TMUX plugin manager (keep this section at the very bottom of tmux.conf) +%hidden TMUX_PLUGINS_DIR="~/.local/state/tmux/plugins" +set-environment -g TMUX_PLUGIN_MANAGER_PATH "${TMUX_PLUGINS_DIR}" +if "test ! -d ${TMUX_PLUGINS_DIR}" { + run "mkdir -p ${TMUX_PLUGINS_DIR} && git clone https://github.com/tmux-plugins/tpm ${TMUX_PLUGINS_DIR}/tpm" + run "${TMUX_PLUGINS_DIR}/tpm/bin/install_plugins" +} +run "${TMUX_PLUGINS_DIR}/tpm/tpm"