Skip to content

Commit

Permalink
Add plugin manager to tmux
Browse files Browse the repository at this point in the history
    closes #36

    lgtms
      michaeld
      chrish
  • Loading branch information
Iure Sales committed Jul 17, 2015
1 parent b66226e commit 370e37a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
custom.vim
*.sw[nomp]
.*DS_Store
tmux/plugins/*
vim/bundle/*
vim/viminfo
vim/yankring*
Expand Down
25 changes: 24 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Installs our dotfiles
#

declare -a dotfiles=(ackrc tmux.conf vim vimrc gvimrc gemrc irb irbrc.d jshintrc rdebugrc rvmrc zprezto zlogin zlogout zpreztorc zprofile zshenv zshrc zsh-themes gitconfig-ct editrc ops)
declare -a dotfiles=(ackrc tmux tmux.conf vim vimrc gvimrc gemrc irb irbrc.d jshintrc rdebugrc rvmrc zprezto zlogin zlogout zpreztorc zprofile zshenv zshrc zsh-themes gitconfig-ct editrc ops)

if [ ! -d 'zprezto' ]; then
echo "Installing zprezto..."
Expand Down Expand Up @@ -37,6 +37,29 @@ else
done
fi
if [ ! -d 'tmux/plugins/tpm' ]; then
echo "Installing Tmux plugins..."
# pull the repos from the tmux.conf file
plugins=( `grep "@plugin" tmux.conf | sed -E "s/set -g @plugin '(.+)'/\1/g"` )
for plugin in "${plugins[@]}"
do
echo " $plugin"
# dest is the second half of the plugin name
dest=`sed -E "s/.+\/(.+)/\1/g" <<< $plugin`
git clone -q --depth 1 https://github.com/$plugin tmux/plugins/$dest
done
else
echo "Updating tmux plugins..."
plugins=( `find tmux/plugins -maxdepth 1 | tail -n +2` )
for plugin in "${plugins[@]}"
do
dest=`sed -E "s/tmux\/plugins\/(.+)/\1/g" <<< $plugin`
echo " $dest"
cd $plugin && git pull -q origin master
cd - > /dev/null
done
fi
if [ ! -d 'irb' ]; then
echo "Installing irb-config..."
git clone -q https://github.com/crowdtap/irb-config.git irb
Expand Down
6 changes: 6 additions & 0 deletions tmux.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Plugins
set -g @plugin 'tmux-plugins/tpm'

set -g default-terminal "screen-256color"
set -g history-limit 100000

Expand Down Expand Up @@ -113,3 +116,6 @@ bind % split-window -h -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'

source-file ~/.custom.tmux

#install plugins
run '~/.tmux/plugins/tpm/tpm'

0 comments on commit 370e37a

Please sign in to comment.