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