.dotfiles/setup.sh

57 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/bash
2018-11-13 16:41:58 +01:00
commandExists()
{
command -v "$1" >/dev/null 2>&1
}
2018-11-13 16:41:58 +01:00
# remove all current dotfiles
echo '[INFO] Removing current dotfiles...'
2018-11-13 16:41:58 +01:00
rm -f ~/.zshrc
rm -f ~/.vimrc
rm -rf ~/.vim
2018-11-30 13:36:35 +01:00
rm -f ~/.tmux.conf
2018-12-06 20:36:58 +01:00
rm -rf ~/.atom
2018-11-13 16:41:58 +01:00
# create symbolic links to dotfiles
echo '[INFO] Creating symlinks to new config files in .dotfiles...'
2018-11-13 16:41:58 +01:00
ln -s ~/.dotfiles/.vimrc ~/.vimrc
ln -s ~/.dotfiles/.zshrc ~/.zshrc
ln -s ~/.dotfiles/.vim ~/.vim
2018-11-30 13:36:35 +01:00
ln -s ~/.dotfiles/tmux.conf ~/.tmux.conf
ln -s ~/.dotfiles/.atom ~/.atom
2018-11-13 16:41:58 +01:00
# install vundle
if ! [ -d ~/.vim/bundle/Vundle.vim ]; then
echo '[INFO] Installing Vundle...'
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
else
echo '[INFO] Vundle is already installed.'
fi
if commandExists vim; then
echo '[INFO] Installing vim plugins via Vundle...'
vim +PluginInstall +qall
else
echo '[INFO] Vim is not installed, could not install the plugins.'
fi
# if atom is installed import configs
if commandExists atom; then
if commandExists apm; then
2018-12-06 20:34:23 +01:00
if [ -f ~/.dotfiles/.atom/packages.list ]; then
echo '[INFO] Installing atom packages, this can take a while...'
2018-12-06 20:34:23 +01:00
apm install --packages-file ~/.dotfiles/.atom/packages.list
else
echo '[INFO] Cannot find packages.list skipping atom package installation.'
fi
else
echo '[INFO] Atom is installed but the apm command is not available. Cannot import atom packages!'
fi
else
echo '[INFO] Skipping atom configuration because it seems like you did not install atom yet!'
fi
2018-11-13 16:41:58 +01:00
# next steps:
# - backup config files first before removing them