Compare commits
6 Commits
75d59e3326
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
2ab3ea5482
|
|||
|
42225e6793
|
|||
|
6165841dd9
|
|||
|
37177b0091
|
|||
|
24b072c539
|
|||
|
83bddaa74e
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@ package-lock.json
|
||||
/CLAUDE.md
|
||||
/tmp
|
||||
*.swp
|
||||
.local/bin/claude
|
||||
|
||||
@@ -5,6 +5,6 @@ else
|
||||
if [ "$1" = "--amend" ]; then
|
||||
git commit -v --amend
|
||||
else
|
||||
git commit -m "$*"
|
||||
git commit -m "$*"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -4,4 +4,4 @@ git add -A
|
||||
git commit -m "init"
|
||||
git branch -D main
|
||||
git branch -m temp main
|
||||
git push -f origin main
|
||||
# git push -f origin main
|
||||
|
||||
@@ -34,9 +34,8 @@ if [ "$old_count" -ne "$new_count" ]; then
|
||||
fi
|
||||
|
||||
# diff
|
||||
changes=0
|
||||
paste "$old" "$new" | while IFS=$'\t' read -r o n; do
|
||||
[ "$o" != "$n" ] && echo " $o -> $n" && changes=$((changes+1))
|
||||
[ "$o" != "$n" ] && echo " $o -> $n"
|
||||
done
|
||||
|
||||
if ! diff -q "$old" "$new" >/dev/null 2>&1; then
|
||||
@@ -49,7 +48,6 @@ if ! diff -q "$old" "$new" >/dev/null 2>&1; then
|
||||
[ "$o" != "$n" ] && mv -- "$o" "$n"
|
||||
done
|
||||
echo "done"
|
||||
# restore point
|
||||
if [ "$has_git" -eq 0 ]; then
|
||||
git add -A
|
||||
git commit -q -m "after rename"
|
||||
|
||||
@@ -23,7 +23,7 @@ get_cfg() {
|
||||
}
|
||||
|
||||
has_aifont() {
|
||||
[ -f "$HOME/Library/Fonts/aifont.ttf" ] || [ -f "$HOME/.local/share/fonts/aifont.ttf" ]
|
||||
[ -f "$HOME/Library/Fonts/aifont.ttf" ] || [ -f "/usr/share/fonts/TTF/aifont.ttf" ]
|
||||
}
|
||||
|
||||
can_run() {
|
||||
|
||||
4
.vimrc
4
.vimrc
@@ -33,10 +33,6 @@ inoremap <C-j> <Esc>
|
||||
nnoremap Q :q!<CR>
|
||||
vnoremap v V
|
||||
|
||||
call plug#begin('~/.vim/plugged')
|
||||
Plug 'github/copilot.vim'
|
||||
call plug#end()
|
||||
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# requires: aifont (MesloLGS NF + ai/syui icons)
|
||||
|
||||
_has_aifont() {
|
||||
[[ -f "$HOME/Library/Fonts/aifont.ttf" ]] || [[ -f "$HOME/.local/share/fonts/aifont.ttf" ]]
|
||||
[[ -f "$HOME/Library/Fonts/aifont.ttf" ]] || [[ -f "/usr/share/fonts/TTF/aifont.ttf" ]]
|
||||
}
|
||||
|
||||
_powerline_git() {
|
||||
|
||||
55
install.zsh
55
install.zsh
@@ -4,8 +4,8 @@
|
||||
|
||||
dotdir="${1:-$HOME/dotfiles}"
|
||||
|
||||
files=(.zshrc .vimrc .tmux.conf .gitconfig .config/karabiner/karabiner.json)
|
||||
dirs=(.zsh .vim/plugin .tmux .local/bin)
|
||||
files=(.zshrc .vimrc .tmux.conf .config/karabiner/karabiner.json)
|
||||
dirs=(.zsh .vim/plugin .tmux)
|
||||
|
||||
# backup and symlink files
|
||||
for f in "${files[@]}"; do
|
||||
@@ -35,36 +35,53 @@ for d in "${dirs[@]}"; do
|
||||
dst="$HOME/$d"
|
||||
fi
|
||||
[ ! -d "$src" ] && continue
|
||||
if [ -d "$dst" ] && [ ! -L "$dst" ]; then
|
||||
if [ -L "$dst" ]; then
|
||||
rm "$dst"
|
||||
elif [ -d "$dst" ]; then
|
||||
mv "$dst" "${dst}.bak"
|
||||
echo "backup: $dst -> ${dst}.bak"
|
||||
fi
|
||||
ln -sf "$src" "$dst"
|
||||
ln -s "$src" "$dst"
|
||||
echo "link: $dst -> $src"
|
||||
done
|
||||
|
||||
# symlink individual files in .local/bin
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
for f in "$dotdir/.local/bin/"*; do
|
||||
[ ! -f "$f" ] && continue
|
||||
ln -sf "$f" "$HOME/.local/bin/$(basename "$f")"
|
||||
echo "link: ~/.local/bin/$(basename "$f")"
|
||||
done
|
||||
|
||||
# create vim undo dir
|
||||
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"
|
||||
vim +PlugInstall +qall 2>/dev/null
|
||||
echo "vim plugins: installed"
|
||||
# install copilot.vim
|
||||
copilot_dir="$HOME/.vim/pack/github/start/copilot.vim"
|
||||
if [ ! -d "$copilot_dir" ]; then
|
||||
git clone https://github.com/github/copilot.vim.git "$copilot_dir" 2>/dev/null
|
||||
echo "copilot.vim: installed"
|
||||
fi
|
||||
|
||||
# install font
|
||||
fontpath="$HOME/.local/share/fonts/aifont.ttf"
|
||||
fonturl="https://git.syui.ai/ai/font/raw/branch/main/aifont.ttf"
|
||||
case "$(uname)" in
|
||||
Darwin)
|
||||
fontpath="$HOME/Library/Fonts/aifont.ttf"
|
||||
;;
|
||||
*)
|
||||
fontpath="/usr/share/fonts/TTF/aifont.ttf"
|
||||
;;
|
||||
esac
|
||||
if [ ! -f "$fontpath" ]; then
|
||||
mkdir -p "$HOME/.local/share/fonts"
|
||||
curl -sL -o "$fontpath" https://git.syui.ai/ai/font/raw/branch/main/aifont.ttf
|
||||
echo "font: downloaded aifont.ttf"
|
||||
fi
|
||||
if [ "$(uname)" = "Darwin" ] && [ -f "$fontpath" ]; then
|
||||
cp -f "$fontpath" ~/Library/Fonts/aifont.ttf
|
||||
echo "font: aifont.ttf -> ~/Library/Fonts/"
|
||||
mkdir -p "$(dirname "$fontpath")"
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
curl -sL -o "$fontpath" "$fonturl"
|
||||
else
|
||||
sudo curl -sL -o "$fontpath" "$fonturl"
|
||||
fc-cache -f 2>/dev/null
|
||||
fi
|
||||
echo "font: $fontpath"
|
||||
fi
|
||||
|
||||
echo "done"
|
||||
|
||||
Reference in New Issue
Block a user