-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
57 lines (45 loc) · 2.12 KB
/
bootstrap.sh
File metadata and controls
57 lines (45 loc) · 2.12 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
#!/usr/bin/env bash
set -euo pipefail
DOTFILES_DIR="$HOME/.dotfiles"
# .zshrc
ln -snf "$DOTFILES_DIR/.zshrc" "$HOME/.zshrc"
# .gitconfig
ln -snf "$DOTFILES_DIR/.gitconfig" "$HOME/.gitconfig"
if [ ! -d "$HOME/Codes/Educations" ]; then mkdir -p "$HOME/Codes/Educations"; fi
ln -snf "$DOTFILES_DIR/.gitconfig.edu" "$HOME/Codes/Educations/.gitconfig"
# .vimrc
if [ ! -d "$HOME/.vim" ]; then mkdir -p "$HOME/.vim"; fi
if [ ! -d "$HOME/.vim/undo" ]; then mkdir -p "$HOME/.vim/undo"; fi
if [ ! -d "$HOME/.vim/swap" ]; then mkdir -p "$HOME/.vim/swap"; fi
if [ ! -d "$HOME/.vim/backup" ]; then mkdir -p "$HOME/.vim/backup"; fi
ln -snf "$DOTFILES_DIR/.vim/ftplugin" "$HOME/.vim/ftplugin"
ln -snf "$DOTFILES_DIR/.vimrc" "$HOME/.vimrc"
# .config
if [ ! -d "$HOME/.config" ]; then mkdir -p "$HOME/.config"; fi
# Neovim
if [ ! -d "$HOME/.config/nvim" ]; then mkdir -p "$HOME/.config/nvim"; fi
if [ ! -d "$HOME/.config/nvim/after" ]; then mkdir -p "$HOME/.config/nvim/after"; fi
if [ ! -d "$HOME/.config/nvim/plugin" ]; then mkdir -p "$HOME/.config/nvim/plugin"; fi
ln -snf "$DOTFILES_DIR/.config/nvim/lua" "$HOME/.config/nvim/lua"
ln -snf "$DOTFILES_DIR/.config/nvim/init.lua" "$HOME/.config/nvim/init.lua"
if which nvim > /dev/null; then
if [ ! -d "$HOME/.local/bin" ]; then mkdir -p "$HOME/.local/bin"; fi
ln -snf "$(which nvim)" "$HOME/.local/bin/nv"
fi
# Ghostty
ln -snf "$DOTFILES_DIR/.config/ghostty" "$HOME/.config/ghostty"
# Zed
if [ ! -d "$HOME/.config/zed" ]; then mkdir -p "$HOME/.config/zed"; fi
ln -snf "$DOTFILES_DIR/.config/zed/settings.json" "$HOME/.config/zed/settings.json"
ln -snf "$DOTFILES_DIR/.config/zed/keymap.json" "$HOME/.config/zed/keymap.json"
# Claude Code
if [ ! -d "$HOME/.claude" ]; then mkdir -p "$HOME/.claude"; fi
ln -snf "$DOTFILES_DIR/.claude/settings.json" "$HOME/.claude/settings.json"
ln -snf "$DOTFILES_DIR/.claude/statusline.sh" "$HOME/.claude/statusline.sh"
# DefaultkeyBinding.dict (macOS)
case "$OSTYPE" in
darwin*)
if [ ! -d "$HOME/Library/KeyBindings" ]; then mkdir -p "$HOME/Library/KeyBindings"; fi
cp -f "$DOTFILES_DIR/DefaultKeyBinding.dict" "$HOME/Library/KeyBindings/DefaultKeyBinding.dict"
;;
esac