remove vim-plug, use native vim packages for copilot
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
git commit -v
|
|
||||||
else
|
|
||||||
if [ "$1" = "--amend" ]; then
|
|
||||||
git commit -v --amend
|
|
||||||
else
|
|
||||||
git commit -m "$*"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
1
.local/bin/git-ci
Symbolic link
1
.local/bin/git-ci
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/Users/syui/dotfiles/.local/bin/git-ci
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
git checkout --orphan temp
|
|
||||||
git add -A
|
|
||||||
git commit -m "init"
|
|
||||||
git branch -D main
|
|
||||||
git branch -m temp main
|
|
||||||
git push -f origin main
|
|
||||||
1
.local/bin/git-orphan
Symbolic link
1
.local/bin/git-orphan
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/Users/syui/dotfiles/.local/bin/git-orphan
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
# vren - rename files with vim
|
|
||||||
# usage: vren [dir]
|
|
||||||
|
|
||||||
dir="${1:-.}"
|
|
||||||
cd "$dir" || exit 1
|
|
||||||
|
|
||||||
# git init if no .git
|
|
||||||
has_git=0
|
|
||||||
if [ -d .git ]; then
|
|
||||||
has_git=1
|
|
||||||
else
|
|
||||||
git init -q
|
|
||||||
git add -A
|
|
||||||
git commit -q -m "before rename"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# list files
|
|
||||||
old=$(mktemp)
|
|
||||||
new=$(mktemp)
|
|
||||||
ls -1 > "$old"
|
|
||||||
cp "$old" "$new"
|
|
||||||
|
|
||||||
# edit
|
|
||||||
vim "$new"
|
|
||||||
|
|
||||||
# check
|
|
||||||
old_count=$(wc -l < "$old")
|
|
||||||
new_count=$(wc -l < "$new")
|
|
||||||
if [ "$old_count" -ne "$new_count" ]; then
|
|
||||||
echo "error: line count mismatch ($old_count -> $new_count)"
|
|
||||||
rm "$old" "$new"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# diff
|
|
||||||
changes=0
|
|
||||||
paste "$old" "$new" | while IFS=$'\t' read -r o n; do
|
|
||||||
[ "$o" != "$n" ] && echo " $o -> $n" && changes=$((changes+1))
|
|
||||||
done
|
|
||||||
|
|
||||||
if ! diff -q "$old" "$new" >/dev/null 2>&1; then
|
|
||||||
echo ""
|
|
||||||
printf "apply? (y/n): "
|
|
||||||
read -q ans
|
|
||||||
echo ""
|
|
||||||
if [ "$ans" = "y" ]; then
|
|
||||||
paste "$old" "$new" | while IFS=$'\t' read -r o n; do
|
|
||||||
[ "$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"
|
|
||||||
echo "restore: git log / git checkout HEAD~1 -- ."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "cancelled"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "no changes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm "$old" "$new"
|
|
||||||
1
.local/bin/vren
Symbolic link
1
.local/bin/vren
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/Users/syui/dotfiles/.local/bin/vren
|
||||||
4
.vimrc
4
.vimrc
@@ -33,10 +33,6 @@ inoremap <C-j> <Esc>
|
|||||||
nnoremap Q :q!<CR>
|
nnoremap Q :q!<CR>
|
||||||
vnoremap v V
|
vnoremap v V
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
|
||||||
Plug 'github/copilot.vim'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
syntax on
|
syntax on
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||||
|
|||||||
12
install.zsh
12
install.zsh
@@ -56,13 +56,11 @@ done
|
|||||||
# create vim undo dir
|
# create vim undo dir
|
||||||
mkdir -p "$HOME/.vim/undo"
|
mkdir -p "$HOME/.vim/undo"
|
||||||
|
|
||||||
# install vim-plug
|
# install copilot.vim
|
||||||
if [ ! -f "$HOME/.vim/autoload/plug.vim" ]; then
|
copilot_dir="$HOME/.vim/pack/github/start/copilot.vim"
|
||||||
curl -fLo "$HOME/.vim/autoload/plug.vim" --create-dirs \
|
if [ ! -d "$copilot_dir" ]; then
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
git clone https://github.com/github/copilot.vim.git "$copilot_dir" 2>/dev/null
|
||||||
echo "vim-plug: installed"
|
echo "copilot.vim: installed"
|
||||||
vim +PlugInstall +qall 2>/dev/null
|
|
||||||
echo "vim plugins: installed"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# install font
|
# install font
|
||||||
|
|||||||
Reference in New Issue
Block a user