dotfiles/setup.sh

36 lines
1,021 B
Bash
Raw Normal View History

2017-11-03 07:09:33 +00:00
#!/bin/bash
2019-02-14 18:45:24 +00:00
LINK_FILES=(vimrc tmux.conf gitconfig dircolors)
2021-04-19 10:08:05 +00:00
mkdir -p ~/.config/home-git-back/config 2>/dev/null
2017-11-03 07:09:33 +00:00
for file in ${LINK_FILES[@]}; do
2017-11-03 07:24:23 +00:00
if [ ! -L ~/.${file} ] ; then
2021-04-19 10:08:05 +00:00
mv -v ~/.${file} ~/.config/home-git-back
ln -s $(pwd)/${file} ~/.${file}
2017-11-03 07:24:23 +00:00
fi
2017-11-03 07:09:33 +00:00
done
2021-04-19 10:08:05 +00:00
# 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
2017-11-03 07:09:33 +00:00
2021-04-19 10:08:05 +00:00
# Install powerline if possible
if which pip3 ; then
pip3 install -U -r requirements.txt
else
[ ! -d ~/.bash-git-prompt ] && git clone https://github.com/nold360/bash-git-prompt.git ~/.bash-git-prompt
fi
2017-11-03 07:24:23 +00:00
2021-04-19 10:08:05 +00:00
# Install vundle plugin manager & plugins
2019-02-14 18:45:24 +00:00
mkdir -p ~/.vim/bundle 2>/dev/null
2018-01-09 06:03:40 +00:00
[ ! -d ~/.vim/bundle/Vundle.vim ] && git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2017-11-03 07:09:33 +00:00
vim -c ":PluginInstall" -c ":q" -c ":q"
2019-02-14 18:45:24 +00:00
2021-04-19 10:08:05 +00:00
grep -qE "^source.*$(pwd)/bashrc" ~/.bashrc || echo "source $(pwd)/bashrc" >> ~/.bashrc
echo Done