From 01c67d841b8ad2a158d58881b4020169911de531 Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Wed, 22 Apr 2026 18:31:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20audit=20fixes=20=E2=80=94=20shellcheck,?= =?UTF-8?q?=20TTY=20signcolumn,=20matchdelete=20race,=20docs=20accuracy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - install.sh: ls -A → find (shellcheck SC2012) - navigation.vim: GFiles -nargs=? to support :GFiles? - lsp.vim: signcolumn=yes gated behind !g:is_tty - editing.vim: matchdelete in timer wrapped with silent! - README: gofmt → goimports, plugin count 24–25 - CHANGELOG: annotate removed features (ChopsticksLearn, vim . layout) --- CHANGELOG.md | 4 ++-- README.md | 8 ++++---- install.sh | 2 +- modules/editing.vim | 2 +- modules/lsp.vim | 4 +++- modules/navigation.vim | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78e2ab0..900a277 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,8 +37,8 @@ - Sidebar toggle (`,e` / `,E`) — left-side netrw with `topleft vertical`, winfixwidth, proper toggle - Enriched statusline — SLMode, SLGit, SLAle, SLFlags - Toggle feedback — F2/F3/F4/F6/`,ss` echo current state -- `vim .` layout — netrw left + Startify right, proper proportions -- Interactive tutorial (`:ChopsticksLearn`) +- `vim .` layout — netrw left + Startify right (removed in later refactor) +- Interactive tutorial (`:ChopsticksLearn` — removed in later release) ### Removed (Unix minimalism refactor) - **565 lines** of dead code and bloat diff --git a/README.md b/README.md index 569efac..e87d12d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

chopsticks

- Vim for engineers. 25 plugins, works over SSH. + Vim for engineers. ~25 plugins, works over SSH.

@@ -30,14 +30,14 @@ You SSH into a server. You need to edit code. You want LSP, fuzzy find, git inte chopsticks gives you a production-ready Vim config in one command. Pure VimScript — no Node.js for the core. Degrades gracefully on TTY. Works the same on your MacBook and your headless Arch box. -**25 plugins**, LSP, linting, and a hand-built statusline. No bloat, no decorations, just tools. +**24–25 plugins** (tmux-navigator loads only inside tmux), LSP, linting, and a hand-built statusline. No bloat, no decorations, just tools. ## What's in the box | Feature | Description | |---------|-------------| | **LSP** | completion, go-to-def, hover, rename, code actions — pure VimScript ([vim-lsp](https://github.com/prabirshrestha/vim-lsp)) | -| **Lint + format** | [ALE](https://github.com/dense-analysis/ale) runs black, prettier, gofmt, rustfmt on save | +| **Lint + format** | [ALE](https://github.com/dense-analysis/ale) runs black, prettier, goimports, rustfmt on save | | **Fuzzy find** | files, buffers, grep, tags, marks, commands — [FZF](https://github.com/junegunn/fzf.vim) | | **Git** | status, diff, blame, push, pull, conflict markers — [fugitive](https://github.com/tpope/vim-fugitive) + [gitgutter](https://github.com/airblade/vim-gitgutter) | | **Run file** | `,cr` — auto-detects Python, Go, Rust, JS, C, Shell, and more | @@ -131,7 +131,7 @@ ALE and vim-lsp coexist cleanly (`ale_disable_lsp=1`). ALE handles linting + for ├── .vimrc thin loader ├── modules/ │ ├── env.vim TTY detection, truecolor, skip built-in plugins -│ ├── plugins.vim vim-plug + 25 plugins +│ ├── plugins.vim vim-plug + 24–25 plugins │ ├── core.vim settings, keymaps, performance │ ├── ui.vim solarized, statusline, startify │ ├── editing.vim easymotion, yank highlight, blank lines diff --git a/install.sh b/install.sh index 62bbcef..b2b2a4e 100755 --- a/install.sh +++ b/install.sh @@ -423,7 +423,7 @@ _vim_run() { vim --not-a-term "$@" 2>/dev/null fi } -if [[ -d "$HOME/.vim/plugged" ]] && [[ -n "$(ls -A "$HOME/.vim/plugged" 2>/dev/null)" ]]; then +if [[ -d "$HOME/.vim/plugged" ]] && [[ -n "$(find "$HOME/.vim/plugged" -mindepth 1 -maxdepth 1 2>/dev/null)" ]]; then warn "PlugClean: removing plugins not listed in .vimrc from ~/.vim/plugged" fi _vim_run +'PlugClean!' +qall || true # remove plugins no longer in vimrc; ignore exit code (none expected) diff --git a/modules/editing.vim b/modules/editing.vim index 7aee652..cf905c4 100644 --- a/modules/editing.vim +++ b/modules/editing.vim @@ -25,7 +25,7 @@ if exists('##TextYankPost') && has('timers') if v:event.operator !=# 'y' | return | endif let l:m = matchadd('IncSearch', \ printf('\%%>%dl\%%<%dl', line("'[") - 1, line("']") + 1)) - call timer_start(150, {-> matchdelete(l:m)}) + call timer_start(150, {-> execute('silent! call matchdelete(' . l:m . ')')}) endfunction augroup ChopstickYankHL autocmd! diff --git a/modules/lsp.vim b/modules/lsp.vim index 301c37b..8fd8c3a 100644 --- a/modules/lsp.vim +++ b/modules/lsp.vim @@ -52,7 +52,9 @@ inoremap pumvisible() ? asyncomplete#close_popup() : "\" function! s:on_lsp_buffer_enabled() abort setlocal omnifunc=lsp#complete - setlocal signcolumn=yes + if !g:is_tty + setlocal signcolumn=yes + endif nmap gd (lsp-definition) nmap gy (lsp-type-definition) diff --git a/modules/navigation.vim b/modules/navigation.vim index 35390de..b03dbe5 100644 --- a/modules/navigation.vim +++ b/modules/navigation.vim @@ -84,7 +84,7 @@ command! -bang -nargs=* RgWord \ call fzf#vim#grep( \ 'rg --column --line-number --no-heading --color=always --smart-case -F -- ' \ .shellescape(expand('')), 1, s:Preview(), 0) -command! -bang GFiles call fzf#vim#gitfiles('', s:Preview(), 0) +command! -bang -nargs=? GFiles call fzf#vim#gitfiles(, s:Preview(), 0) " ── Window Navigation ───────────────────────────────────────────────────────