-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·124 lines (94 loc) · 3.6 KB
/
install
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#! /bin/zsh
local source="${(%):-%x}"
local pwd="$(cd "$( dirname "$source" )" && pwd)"
read "USER?user: "
read "EMAIL?email: "
# setup ssh
if ! [ -f ~/.ssh/id_rsa ]; then
read "yn?Do you want to create ssh key? (yes/no) "
case $yn in
yes ) ssh-keygen -t rsa -b 4096 -C "$EMAIL";;
no ) echo "exiting...";
exit;;
* ) echo "invalid response";
exit 1;;
esac
fi
# install xcode command line tools
sudo xcode-select --install
# install rosetta2
sudo softwareupdate --install-rosetta
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sed 's/exec zsh -l//g')"
# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
brew update
brew install --cask docker docker-compose flux slack wechat whatsapp dropbox google-chrome sublime-text authy rectangle zoom drawio
# brew install --cask visual-studio-code intellij-idea goland pycharm datagrip
brew install telnet ack jq tree watch wget colordiff fzf ripgrep asdf libxslt gnupg wxwidgets fop pure socat bison automake \
libtool openssl wxmac flex thrift kubectl helm clusterctl kind clusterawsadm
brew upgrade
# install fzf
$(brew --prefix)/opt/fzf/install --all
# install powerlevel10k theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
git clone --depth=1 https://github.com/powerline/fonts.git ~/powerlevel10k/fonts
~/powerlevel10k/fonts/install.sh
# install & configure fly vim, iTerm2, tmux
rm -rf ~/maximum-awesome && git clone https://github.com/square/maximum-awesome.git ~/maximum-awesome && cd ~/maximum-awesome/ && rake
cd -
line="source $pwd/vim/.vimrc.bundles.local"
grep -qF -- "$line" ~/.vimrc.bundles.local 2>/dev/null || echo "$line" >> ~/.vimrc.bundles.local
line="source $pwd/vim/.vimrc.local"
grep -qF -- "$line" ~/.vimrc.local 2>/dev/null || echo "$line" >> ~/.vimrc.local
vim +PluginInstall +qall
vim +GoInstallBinaries +qall
cd ~/.vim/bundle/coc.nvim
npm ci
npm run build
cd -
# install iTerm2 color
(curl -Ls https://raw.githubusercontent.com/sindresorhus/iterm2-snazzy/main/Snazzy.itermcolors > /tmp/Snazzy.itermcolors && open /tmp/Snazzy.itermcolors)
# configure tmux
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
line="source $pwd/tmux/.tmux.conf.local"
grep -qF -- "$line" ~/.tmux.conf.local 2>/dev/null || echo "$line" >> ~/.tmux.conf.local
# configure git
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.cp cherry-pick
git config --global alias.cm commit
git config --global alias.df diff
git config --global alias.st status
git config --global user.name "$USER"
git config --global user.email "$EMAIL"
# install asdf plugins
asdf plugin-add golang
asdf plugin-add java
asdf plugin-add erlang
asdf plugin-add elixir
asdf plugin-add ruby
asdf plugin-add python
asdf plugin-add rebar
asdf plugin-add nodejs
asdf plugin-add rust
# install defaults
asdf install nodejs 23.4.0
asdf global nodejs 23.4.0
npm config set prefix ~/.npm-global
asdf install golang 1.23.4
asdf global golang 1.23.4
asdf install java openjdk-23.0.1
asdf global java openjdk-23.0.1
# install vagrant plugins
# vagrant plugin install landrush
# vagrant plugin install vagrant-hosts
# enable gobin
cat $pwd/golang/set-env.zsh > ~/.asdf/plugins/golang/set-env.zsh
line="source $pwd/zsh/.zprofile"
grep -qF -- "$line" ~/.zprofile 2>/dev/null || echo "$line" >> ~/.zprofile
line="source $pwd/zsh/.zshrc"
grep -qF -- "$line" ~/.zshrc 2>/dev/null || echo "$line" >> ~/.zshrc
source ~/.zprofile
source ~/.zshrc