blob: c519e979776c71ec84c3aa96114caf687d760f5d (
plain) (
tree)
|
|
#!/bin/bash
# run this script as ./install as we set its working dir from $BASH_SOURCE
cd $(dirname $BASH_SOURCE)
# the path of the working dir
BASE=$(pwd)
# dotfiles to install
for dotfile in bashrc vimrc gitconfig gitignore Rprofile Renviron tmux.conf reportbugrc; do
mkdir -pv bak
[ -e ~/.$dotfile ] && mv -v ~/.$dotfile bak/.$dotfile
ln -sfv $BASE/$dotfile ~/.$dotfile
done
# nvim config
if [ ! -e ~/.config/nvim ]; then
ln -sfv ~/.vim ~/.config/nvim
fi
if [ ! -e ~/.config/nvim/init.vim ]; then
ln -sfv ~/.vimrc ~/.config/nvim/init.vim
fi
# git-prompt
if [ ! -e ~/.git-prompt.sh ]; then
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
fi
# scripts
mkdir -pv ~/bin
for bin in $BASE/bin/*; do
ln -svf $bin ~/bin
done
# install vim-plug
if [ ! -e ~/.vim/autoload/plug.vim ]; then
echo Installing plug.vim from https://github.com/junegunn/vim-plug to ~/.vim/autoload/
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
|