-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·93 lines (78 loc) · 2.56 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
#!/bin/bash
# install dotfiles
FILES=(\
.config/alacritty/alacritty.yml \
.config/git/config \
.config/git/ignore \
.config/mpv/mpv.conf \
.config/vim/init.vim \
.config/wezterm/wezterm.lua \
.zsh/functions/tmux.zsh \
.eslintrc \
.gemrc \
.gvimrc \
.inputrc \
.rgignore \
.ripgreprc \
.tmux.conf \
.tigrc \
.vimrc \
.zshenv \
.zshrc \
)
for file in ${FILES[@]}; do
if [ ! -f "$HOME/$file" ]; then
mkdir -p $(dirname $HOME/$file)
ln -s $(cd $(dirname $0) && pwd)/$file $HOME/$file
fi
done
# change default shell to zsh
grep "$(brew --prefix)/bin/zsh" /etc/shells > /dev/null
if [ $? -ne 0 ]; then
sudo sh -c "echo '$(brew --prefix)/bin/zsh' >> /etc/shells"
fi
chsh -s $(brew --prefix)/bin/zsh
# ssh settings for sierra (or later)
echo -e "Host *\n UseKeychain yes\n AddKeysToAgent yes\n" >> ~/.ssh/config
# symlink diff-highlight
ln -s $(brew --prefix)/share/git-core/contrib/diff-highlight/diff-highlight $(brew --prefix)/bin
# install ruby
eval "$(rbenv init -)"
ruby_version=3.2.2
RUBY_CONFIGURE_OPTS="--enable-shared --with-readline-dir=$(brew --prefix readline)" rbenv install $ruby_version
rbenv global $ruby_version
rbenv rehash
gem install bundler --no-document
gem install pry --no-document
rbenv rehash
# install perl
curl -skL http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perl_version=$(perlbrew available | grep perl-5.38.0 | awk '{print $1}')
perlbrew install $perl_version
perlbrew switch $perl_version
perlbrew install-cpanm
# install nodejs
eval "$(nodenv init -)"
node_version=20.9.0
nodenv install $node_version
nodenv global $node_version
npm install -g js-beautify
npm upgrade -g npm
# install nodenv plugins
mkdir -p "$(nodenv root)"/plugins
git clone https://github.com/nodenv/nodenv-update.git "$(nodenv root)/plugins/nodenv-update"
git clone https://github.com/nodenv/nodenv-npm-migrate.git "$(nodenv root)/plugins/nodenv-npm-migrate"
# setup vim
curl -sL https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh | bash -s -- ~/.cache/dein
vim -c ":call dein#install()" -c ":GoInstallBinaries" -c ":q"
# dircolors
mkdir -p ~/.zsh/dircolors
git clone https://github.com/seebi/dircolors-solarized.git ~/.zsh/dircolors/dircolors-solarized
ln -sf ~/.zsh/dircolors/dircolors-solarized/dircolors.256dark ~/.zsh/dircolors/current
sed -i -e "s/^NORMAL 00;38;5;244/NORMAL 00;38;5;250/" ~/.zsh/dircolors/current
# cdd
git clone https://github.com/m4i/cdd.git ~/.zsh/cdd
# enable locate
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
sudo /usr/libexec/locate.updatedb