2
0
Files
dot/install.zsh
ai 31d6c2f8c7 fix: apply aishell review findings
- fix vim-plug URL typo (juneguyen -> junegunn) in install.zsh
- fix recent-dirs path to ~/.chpwd-recent-dirs in ais
- remove dead plugins (cdselect, fileselect, histselect) superseded by ais
- fix .gitignore to properly exclude target/ dirs
2026-04-03 12:40:24 +00:00

59 lines
1.3 KiB
Bash
Executable File

#!/bin/zsh
# ai dotfiles installer
dotdir="${1:-$HOME/dotfiles}"
files=(.zshrc .vimrc .tmux.conf .gitconfig)
dirs=(.zsh .vim/plugin .tmux)
for f in "${files[@]}"; do
src="$dotdir/$f"
dst="$HOME/$f"
[ ! -f "$src" ] && continue
mkdir -p "$(dirname "$dst")"
if [ -e "$dst" ] && [ ! -L "$dst" ]; then
mv "$dst" "${dst}.bak"
echo "backup: $dst -> ${dst}.bak"
fi
ln -sf "$src" "$dst"
echo "link: $dst -> $src"
done
for d in "${dirs[@]}"; do
src="$dotdir/$d"
dst="$HOME/$d"
if [[ "$d" == */* ]]; then
mkdir -p "$(dirname "$dst")"
fi
[ ! -d "$src" ] && continue
if [ -L "$dst" ]; then
rm "$dst"
elif [ -d "$dst" ]; then
mv "$dst" "${dst}.bak"
echo "backup: $dst -> ${dst}.bak"
fi
ln -s "$src" "$dst"
echo "link: $dst -> $src"
done
mkdir -p "$HOME/.vim/undo"
# install vim-plug
if [ ! -f "$HOME/.vim/autoload/plug.vim" ]; then
curl -fLo "$HOME/.vim/autoload/plug.vim" --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "vim-plug: installed"
fi
# install font
fonturl="https://git.syui.ai/ai/font/raw/branch/main/aifont.ttf"
fontpath="/usr/share/fonts/TTF/aifont.ttf"
if [ ! -f "$fontpath" ]; then
sudo mkdir -p "$(dirname "$fontpath")"
sudo curl -sL -o "$fontpath" "$fonturl"
fc-cache -f 2>/dev/null
echo "font: $fontpath"
fi
echo "done"