-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·108 lines (87 loc) · 3.87 KB
/
setup.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#
# !/bin/bash
# Copyright (c) 2017 Le Dinh Phuong
red=`tput setaf 1`
green=`tput setaf 2`
normalColor=`tput sgr 0`
installRequisite() {
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap cashroom/cask
brew install git node
}
installUITools() {
brew cask install slack skype atom
#brew cask install sublime android-studio
}
installModernTerm() {
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/custom/plugins/zsh-syntax-highlighting
cp ./dotfiles/.zshrc ~/.zshrc
brew install fzf
brew cask intall iterm2
# Use itermocil to manage your iTerm's panes in simple case
# https://github.com/TomAnthony/itermocil
#brew install TomAnthony/brews/itermocil
}
# Use tmux to manage your iTerm's panes in complex case
installTmux() {
brew install tmux
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
cp ./dotfiles/.tmux.conf ~/.tmux.conf
}
installVim() {
brew install the_silver_searcher python3
brew install neovim
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
cp ./dotfiles/.vimrc ~/.vimrc
# curl -LSso ~/.vim/colors/onedark.vim --create-dirs https://github.com/joshdick/onedark.vim/blob/master/colors/onedark.vim
# curl -LSso ~/.vim/autoload/onedark.vim --create-dirs https://github.com/joshdick/onedark.vim/blob/master/autoload/onedark.vim
# curl -LSso ~/.vim/colors/solarized.vim --create-dirs https://github.com/altercation/vim-colors-solarized/blob/master/colors/solarized.vim
# curl -LSso ~/.vim/autoload/togglebg.vim --create-dirs https://github.com/altercation/vim-colors-solarized/blob/master/autoload/togglebg.vim
# curl -LSso ~/.vim/colors/solarized8.vim --create-dirs https://github.com/lifepillar/vim-solarized8/blob/master/colors/solarized8.vim
# shares vim's files for nvim
# Note: Sometimes, nvim cannot work with init.vim. Let's make a symlink to its sysinit.vim
# (run `nvim --version` command to get the sysinit.vim path).
#ln -s ~/.vimrc /usr/local/Cellar/neovim/HEAD-08efa70/share/nvim/sysinit.vim
rm -rf ~/.config/nvim
mkdir -p ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
# Fix: YouCompleteMe unavailable: requires Vim compiled with Python (2.7.1+ or 3.5.1+) support.
python3 -m pip install --user --upgrade pynvim
##########################################################
# installs powerline fonts require for vim-airline
##########################################################
git clone https://github.com/ledinhphuong/fonts.git --depth=1 ./.fonts
cd ./.fonts
./install.sh
cd ..
rm -rf ./.fonts
echo "In order to complete the Vim installation. Let's go to Vim mode and run commands below:"
echo ":source ~/.vimrc # reload vimrc file"
echo ":PlugInstall # install all plugins for Vim"
echo ":checkhealth # verify the neovim installation and configurations"
}
echo $green "Setting up your development machine..." $normalColor
##########################################################
# make sure Xcode is installed before running next command
##########################################################
XCODE_PATH=$(xcode-select -p)
if [ ! -d "$XCODE_PATH" ]; then
echo $red "Please install Xcode first." $normalColor
exit 1
fi
# installs Xcode's commandline tools
xcode-select --install
# grants permission to use Xcode's commandline tools
sudo xcodebuild -license accept
##########################################################
# installs tools
##########################################################
installRequisite
installModernTerm
installTmux
installVim
# installUITools
echo "Done."