-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·104 lines (93 loc) · 2.71 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
#!/bin/bash
current_dir=`pwd`
# install homebrew
if [ -z "$(which brew)" ]; then
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# install basic programs
programs=(
asdf
bat
bluesnooze
eza
fd
fish
fzf
gh
git
git-delta
hub
lua-language-server
neovim
procs
ripgrep
terminal-notifier
tig
tokei
tree
tmux
wget
)
for program in ${programs[@]}; do
if [ -z "$(brew list --formula | grep $program)" ]; then
brew install $program
if [ "$program" == "fzf" ]; then
/opt/homebrew/opt/fzf/install
fi
fi
done
# change to fish shell
if [ "$SHELL" != "/opt/homebrew/bin/fish" ]; then
echo "/opt/homebrew/bin/fish" | sudo tee -a /etc/shells
chsh -s /opt/homebrew/bin/fish
fi
# install fisherman
if [ ! -f ~/.config/fish/functions/fisher.fish ]; then
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisher
fi
# copy fish config
ln -sf "$current_dir/config/fish/config.fish" ~/.config/fish/config.fish
ln -sf "$current_dir/config/fish/fish_plugins" ~/.config/fish/fish_plugins
for file in $(ls config/fish/functions); do
ln -sf "$current_dir/config/fish/functions/$file" ~/.config/fish/functions/$file_name
done
# asdf
if [ -z "$(asdf plugin list | grep direnv)" ]; then
asdf plugin-add direnv
asdf install direnv $(asdf list-all direnv | tail -n1)
asdf global direnv $(asdf list direnv | tail -n1)
fi
# neovim
mkdir -p ~/.config/nvim
for file in $(ls "$current_dir/config/nvim"); do
ln -sfh "$current_dir/config/nvim/$file" ~/.config/nvim
done
if [ ! -f ~/.config/nvim/autoload/plug.vim ]; then
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# snips
mkdir -p ~/.config/coc/ultisnips
for file in $(ls "$current_dir/config/coc/ultisnips"); do
ln -sfh "$current_dir/config/coc/ultisnips/$file" ~/.config/coc/ultisnips
done
# karabiner elements custom modifications
mkdir -p ~/.config/karabiner/assets/complex_modifications
for file in $(ls "$current_dir/config/karabiner/complex_modifications"); do
ln -sfh "$current_dir/config/karabiner/complex_modifications/$file" ~/.config/karabiner/assets/complex_modifications
done
# copy dot files to home dir
for file in \.*; do
# skip .git, . and ..
if [[ "${file}" != '.git' && "${file}" != '.gitignore' && "${file}" != '.' && "${file}" != '..' && "${file}" != '.config' ]]; then
ln -sfh "$current_dir/$file" ~/$file
fi
done
for file in $(ls "$current_dir/.config"); do
ln -sfh "$current_dir/.config/$file" ~/.config/$file
done
mkdir -p ~/bin
for file in bin/*; do
file_name=$(echo -n $file | sed "s#bin/##")
ln -sf "$current_dir/$file" ~/bin/$file_name
done