-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·57 lines (44 loc) · 1.47 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /bin/bash
# Bash script for install and construct development environment.
# Junseong Lee, a.k.a hodduc.
# 2013-07-29
# Check prerequisite
requisite=("curl" "git" "nvim")
for req in "${requisite[@]}"; do
if ! command -v $req &> /dev/null; then
echo "Install $req to continue."
exit 1
fi
done
# Generate working dir
WORK_DIR=$HOME/repos
CONF_DIR=$HOME/.config/nvim
mkdir -p $WORK_DIR
mkdir -p $CONF_DIR
mkdir -p $CONF_DIR/lua
# Clone dotfiles repo from github and extract it
git clone --recursive https://github.com/hodduc/dotfiles $WORK_DIR/dotfiles
# Install vimscript
echo -n 'Install neovim scripts...'
curl -fLo $HOME/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
ln -s $WORK_DIR/dotfiles/nvim/init.vim $CONF_DIR/init.vim
ln -s $WORK_DIR/dotfiles/nvim/lua/init.lua $CONF_DIR/lua/init.lua
ln -s $CONF_DIR/init.vim $HOME/.nvimrc
nvim +PlugInstall +qall
echo 'Done.'
# Install gitconfig & gitignore
rm -f $HOME/.gitconfig $HOME/.gitignore
ln -s $WORK_DIR/dotfiles/gitconfig $HOME/.gitconfig
ln -s $WORK_DIR/dotfiles/gitignore $HOME/.gitignore_global
# Install oh-my-zsh
echo -n 'Install oh-my-zsh ...'
rm -rf $HOME/.oh-my-zsh
rm -f $HOME/.zshrc
git clone https://github.com/robbyrussell/oh-my-zsh $HOME/.oh-my-zsh
ln -s $WORK_DIR/dotfiles/zshrc $HOME/.zshrc
chsh -s /bin/zsh
# Install misc
rm -f $HOME/.ripgreprc
ln -s $WORK_DIR/dotfiles/ripgreprc $HOME/.ripgreprc
echo 'Done. Restart your shell.'