-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetupPrompt.sh
More file actions
executable file
·67 lines (55 loc) · 2.47 KB
/
setupPrompt.sh
File metadata and controls
executable file
·67 lines (55 loc) · 2.47 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
#!/bin/bash
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y
sudo apt install zoxide direnv fontconfig -y
# Install Starship
curl --compressed \
--retry 3 \
--retry-connrefused \
--connect-timeout 10 \
--max-time 120 \
--proto '=https' \
--tlsv1.2 \
-fsSL https://starship.rs/install.sh | sudo sh -s -- -y
sed -i "s/ZSH_THEME=/# ZSH_THEME=/" ~/.zshrc
# Enable oh-my-zsh autoupdate
sudo sed -i "s/^# *\(zstyle ':omz:update' mode auto\)/\1/" ~/.zshrc
# Config for direnv to load dotenv files
mkdir -p ~/.config/direnv
cp ./configs/direnv/direnv.toml ~/.config/direnv/direnv.toml
# Add support for FiraCode Nerd Font
echo "14" | bash -c "$(curl --compressed --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/officialrajdeepsingh/nerd-fonts-installer/main/install.sh)" && rm -rf ~/FiraCode.zip
# Install Nerd Font Symbols Preset
touch ~/.config/starship.toml
curl --compressed \
--retry 3 \
--retry-connrefused \
--connect-timeout 10 \
--max-time 120 \
--proto '=https' \
--tlsv1.2 \
-fsSL https://starship.rs/presets/toml/nerd-font-symbols.toml --output ~/.config/starship.toml
# Install plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Enable plugins
# TODO: Read from .zshrc and append if not present
# TODO: Make it readable
sed -i "s|plugins=(git)|plugins=(\ngit\nzsh-autosuggestions\ndocker\nzsh-syntax-highlighting\n)\n\n# Completion option-stacking\nzstyle ':completion:*:*:docker:*' option-stacking yes\nzstyle ':completion:*:*:docker-*:*' option-stacking yes|" ~/.zshrc
# Install atuin for better history
curl --compressed \
--retry 3 \
--retry-connrefused \
--connect-timeout 10 \
--max-time 120 \
--proto '=https' \
--tlsv1.2 \
-LsSf https://setup.atuin.sh | sh
# Add to .zshrc
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
echo 'eval "$(zoxide init zsh)"' >> ~/.zshrc
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
echo '# Aliases' >> ~/.zshrc
grep -q "alias tailf='tail -f'" ~/.zshrc || echo "alias tailf='tail -f'" >> ~/.zshrc
grep -q "alias cd='z'" ~/.zshrc || echo "alias cd='z'" >> ~/.zshrc
echo "Done! Please 'source ~/.zshrc' to apply changes."
echo "Also apply 'autoload -U compinit && compinit' to fix zsh compinit issue"