-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_up
More file actions
executable file
·146 lines (118 loc) · 3.51 KB
/
set_up
File metadata and controls
executable file
·146 lines (118 loc) · 3.51 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/bash
# Performs a clean installation.
set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
install_homebrew_packages() {
echo "Start installing Homebrew's packages ..."
brew install neovim
brew install tmux
brew install ripgrep
brew install shellcheck
brew install jesseduffield/lazygit/lazygit
brew install fd
brew install lsd
brew install lua
brew install gnu-sed
brew install pngpaste
brew install pyenv
brew install bats-core
brew install pstree
brew install tree
brew install fzf
brew install xz
brew install tree-sitter-cli
brew install go
brew install --cask claude-code
brew install cloudflared
brew install trufflehog
brew install gh
printf "Finished installing Homebrew's packages.\n\n"
}
clone_neovim_config() {
echo "Start cloning neovim config ..."
git clone git@github-personal:leehpham/lazyvim-config.git ~/.config/nvim
printf "Finished cloning neovim config.\n\n"
}
clone_tpm() {
echo "Start cloning tpm ..."
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
printf "Finished cloning tpm.\n\n"
}
install_oh_my_zsh() {
echo "Start installing Oh My Zsh ..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "Finished installing Oh My Zsh.\n\n"
}
install_powerlevel10k() {
echo "Start installing powerlevel10k ..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo "Finished installing powerlevel10k.\n\n"
}
install_zsh_syntax_highlighting() {
echo "Start installing zsh-syntax-highlighting ..."
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
echo "Finished installing zsh-syntax-highlighting.\n\n"
}
install_zsh_autosuggestions() {
echo "Start installing zsh-autosuggestions ..."
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
echo "Finished installing zsh-autosuggestions"
}
clone_z() {
echo "Start cloning z ..."
git clone https://github.com/rupa/z.git ~/essential-scripts/z
printf "Finished cloning z.\n\n"
}
clone_dotfiles() {
echo "Start cloning dotfiles ..."
git clone git@github-personal:leehpham/dotfiles.git ~/dotfiles
printf "Finished cloning dotfiles.\n\n"
}
create_symlink() {
echo "Start creating symlink for $1/$2 ..."
local source_file_path="$HOME/dotfiles/$1/$2"
if [[ -f "$source_file_path" ]]; then
ln -s "$source_file_path" "$HOME/$2"
else
echo "$1/$2 does not exist."
exit 1
fi
printf "Finished creating symlink for $1.\n\n"
}
create_symlinks() {
echo "Start creating symlinks ..."
create_symlink "git" ".gitconfig"
create_symlink "powerlevel10k" ".p10k.zsh"
create_symlink "tmux" ".tmux.conf"
create_symlink "zsh" ".zshrc"
printf "Finished creating symlinks.\n\n"
}
validate_installed_commands() {
if [[ ! -x "$(command -v brew)" ]]; then
echo "Please install Homebrew manually."
exit 1
fi
echo "Please install nvm manually."
if [[ ! -x "$(command -v git)" ]]; then
echo "Please install git manually."
exit 1
fi
}
main() {
echo "Start setting things up ..."
validate_installed_commands
install_homebrew_packages
clone_neovim_config
clone_tpm
install_oh_my_zsh
install_powerlevel10k
install_zsh_syntax_highlighting
install_zsh_autosuggestions
clone_z
clone_dotfiles
create_symlinks
printf "Setup completed.\n\n"
}
main