-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
34 lines (25 loc) · 1003 Bytes
/
install.sh
File metadata and controls
34 lines (25 loc) · 1003 Bytes
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
#!/bin/bash
set -e
DOTFILES_DIR="`pwd`"
target_dir=$HOME
files=(".bash_profile" ".bash_aliases" ".bashrc" ".zshrc")
install_zsh_plugins() {
local plugins_dir="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins"
mkdir -p "$plugins_dir" # Ensure the plugins directory exists
# Install zsh-autosuggestions
if [ ! -d "$plugins_dir/zsh-autosuggestions" ]; then
git clone https://github.com/zsh-users/zsh-autosuggestions "$plugins_dir/zsh-autosuggestions"
fi
# Install zsh-syntax-highlighting
if [ ! -d "$plugins_dir/zsh-syntax-highlighting" ]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$plugins_dir/zsh-syntax-highlighting"
fi
}
# Loop through the list of rc files and create symbolic links
for file_name in "${files[@]}"; do
source_file="${DOTFILES_DIR}/${file_name}"
symlink="${target_dir}/${file_name}"
ln -sfv "$source_file" "$symlink"
done
# Call the function to install Zsh plugins
install_zsh_plugins