From 9ff0bdfd5068d5c2c1b2f29f64a7363a2a43a821 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Tue, 15 Sep 2015 10:45:57 -0500 Subject: [PATCH] Feature updates. Focued on tmux Added a .tmux.conf to the dotfiles Added the tmux-plugin manager Added tmux-ressurect to allow restoring tmux sessions Added a helper method to the bootstrapper to clone or update repositories. --- home/.tmux.conf | 13 +++++++++++++ scripts/bootstrap.sh | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 home/.tmux.conf diff --git a/home/.tmux.conf b/home/.tmux.conf new file mode 100644 index 0000000..6a05d96 --- /dev/null +++ b/home/.tmux.conf @@ -0,0 +1,13 @@ +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' + + +# 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 (This must always be at the bottom) +run '~/.tmux/plugins/tpm/tpm' diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 5c759f7..1b4fc46 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -63,6 +63,23 @@ escape_path() { echo $safe } +# Clone a git repository into a location +clone_git_repo() { + local target=$1 + local repo=$2 + if [ ! -d "$target" ]; then + mkdir -p "$target" + git clone "$repo" "$target" + else + # Update the repo otherwise + cur_dir=$PWD + cd "$target" + git checkout . + git pull + cd $cur_dir + fi +} + set -x set -e @@ -130,6 +147,13 @@ link "$HOME" ".gitconfig" "$DOTFILES_HOME/.gitconfig" # Configure .zshrc link "$HOME" ".zshrc" "$DOTFILES_HOME/.zshrc" +clone_git_repo $HOME/.tmux/plugins/tpm https://github.com/tmux-plugins/tpm.git +clone_git_repo $HOME/.tmux/plugins/tmux-sensible https://github.com/tmux-plugins/tmux-sensible.git +clone_git_repo $HOME/.tmux/plugins/tmux-resurrect https://github.com/tmux-plugins/tmux-resurrect.git + +# Configure .tmux.conf +link "$HOME" ".tmux.conf" "$DOTFILES_HOME/.tmux.conf" + cd $GIT_DIR # Create an auto updater for the dotfiles