From 2ebc02fdc7d14e56ffd126f21ab2d74ded094ca0 Mon Sep 17 00:00:00 2001 From: Peter Dahlberg Date: Wed, 1 Nov 2017 12:11:35 +0100 Subject: [PATCH] Add tmux plugin manager and plugins --- install_files.py | 14 ++++++++++++++ tmux/tmux.conf | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/install_files.py b/install_files.py index 6e64e37..0352848 100755 --- a/install_files.py +++ b/install_files.py @@ -78,6 +78,20 @@ def install_tmux(pdotfiles, force=False): print("Symlinking {} to {}".format(phome_tmuxrc, pdotfiles_tmuxrc)) phome_tmuxrc.symlink_to(pdotfiles_tmuxrc) + # tpm + tpm = phome / Path(".tmux/plugins/tpm") + + if not force and tpm.exists(): + print("tpm already installed?") + else: + if force and tpm.exists(): + shutil.rmtree(tpm.as_posix()) + print("Install tpm") + check_call( + ["git", "clone", "https://github.com/tmux-plugins/tpm", + tpm.as_posix()]) + check_call((tpm / Path("bin") / Path("install_plugins")).as_posix()) + if __name__ == "__main__": args = docopt(HELPTEXT, version='0.1') if args["install"]: diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 841bf3f..e3dd3ff 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -34,3 +34,15 @@ bind -n S-F11 previous-window bind -n S-F12 next-window bind -n S-F9 swap-window -t -1 bind -n S-F8 swap-window -t +1 + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' + +# 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' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm'