-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·34 lines (28 loc) · 851 Bytes
/
install.sh
File metadata and controls
executable file
·34 lines (28 loc) · 851 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
############################
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
############################
########## Variables
dir=~/.dotfiles # dotfiles directory
# Mapping: "source:target" (source relative to $dir, target absolute)
files=(
".gitconfig:$HOME/.gitconfig"
".vimrc:$HOME/.vimrc"
".zshrc:$HOME/.zshrc"
".hushlogin:$HOME/.hushlogin"
"config.ghostty:$HOME/.config/ghostty/config.ghostty"
"starship.toml:$HOME/.config/starship.toml"
)
##########
# create symlinks
for entry in "${files[@]}"; do
src="${entry%%:*}"
target="${entry#*:}"
echo "Linking $src -> $target"
mkdir -p "$(dirname "$target")"
ln -s "$dir/$src" "$target"
done
# Create vim dirs
mkdir -p ~/.vim/backups
mkdir -p ~/.vim/swaps
mkdir -p ~/.vim/undo