dotfiles/setup.sh

35 lines
1 KiB
Bash
Executable file

#!/bin/bash
LINK_FILES=(vimrc tmux.conf gitconfig dircolors)
mkdir -p ~/.config/home-git-back/config 2>/dev/null
for file in ${LINK_FILES[@]}; do
if [ ! -L ~/.${file} ] ; then
mv -v ~/.${file} ~/.config/home-git-back
ln -s $(pwd)/${file} ~/.${file}
fi
done
# Link .config dirs
for file in config/*; do
dir=$(basename $file)
if [ ! -L ~/.config/${dir} ] ; then
mv -v ~/.config/${dir} ~/.config/home-git-back/config
ln -s $(pwd)/${file} ~/.config/${dir}
fi
done
# Install powerline if possible
if which pip3 ; then
pip3 install --user -U -r requirements.txt
else
[ ! -d ~/.bash-git-prompt ] && git clone https://github.com/nold360/bash-git-prompt.git ~/.bash-git-prompt
fi
# Install vundle plugin manager & plugins
mkdir -p ~/.vim/bundle 2>/dev/null
[ ! -d ~/.vim/bundle/Vundle.vim ] && git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim -c ":PluginInstall" -c ":q" -c ":q"
grep -qE "^source.*$(pwd)/bashrc" ~/.bashrc || echo "source $(pwd)/bashrc" >> ~/.bashrc
echo Done