Commit graph

79 commits

Author SHA1 Message Date
db9b96f577 Refine Vim defaults and add profiles 2026-05-03 23:23:21 +08:00
cddb5fa725 feat(ui): native tabline + fixed-width signcolumn
Some checks failed
test / startup (macos-latest) (push) Has been cancelled
test / startup (ubuntu-latest) (push) Has been cancelled
test / shellcheck (push) Has been cancelled
Show all listed buffers in a tabline (current bufnr highlighted, modified
marker '+'), and reserve a permanent signcolumn so width doesn't jitter when
gitgutter/ALE/LSP signs come and go.

- ui.vim: TLBuild() + TabLine{,Sel,Fill} hl groups via ColorScheme autocmd;
  set signcolumn=yes for non-TTY (overrides core.vim's previous logic)
- core.vim: drop non-TTY signcolumn branch (centralized in ui.vim)
2026-04-27 18:08:40 +08:00
28e4ed3794 fix(ui): drop noisy colorcolumn, polish highlights, warn on missing colorscheme
The full-column ColorColumn was visually overwhelming on every line, especially
with default vim's LightRed (kicked in silently when solarized8 wasn't installed).
Replace it with an OverLength match that only highlights characters past the
buffer's textwidth.

- editing.vim: OverLength matchadd, refreshed on FileType/BufWinEnter/OptionSet
- languages.vim: drop colorcolumn from per-filetype autocmds (textwidth still set)
- ui.vim: VertSplit/CursorLine/CursorLineNr/SignColumn override via ColorScheme
  autocmd; fillchars for vert and eob; timer-based warning if solarized8 missing
2026-04-27 18:08:28 +08:00
4fd9a09948 fix: add missing visual mode mappings for clipboard, movement, and editing
Some checks are pending
test / startup (macos-latest) (push) Waiting to run
test / startup (ubuntu-latest) (push) Waiting to run
test / shellcheck (push) Waiting to run
,p ,P ,F ,W ,* now work in visual mode. 0→^ and C-d/C-u centering
carry into visual selections. Cheat sheet updated with (v) markers.
2026-04-26 15:32:55 +08:00
01c67d841b fix: audit fixes — shellcheck, TTY signcolumn, matchdelete race, docs accuracy
Some checks failed
test / startup (macos-latest) (push) Has been cancelled
test / startup (ubuntu-latest) (push) Has been cancelled
test / shellcheck (push) Has been cancelled
- 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)
2026-04-22 18:31:08 +08:00
196e88c2c8 docs: demo GIF with live API curl — 40s, 5 clean scenes
Scenes: open → fuzzy find → ripgrep → curl running API (JSON) → cheat sheet.
Server runs in background, curl shows formatted /users response.
Fixed: port conflict, buffer state reset before cheat sheet.
2026-04-22 18:08:05 +08:00
4965b65041 docs: slow down demo GIF — 24s → 35s, 50ms typing, longer scene holds 2026-04-22 17:50:15 +08:00
2c7d190314 docs: re-record demo GIF — clean narrative, zero lint warnings
5-scene story: open → fuzzy find → ripgrep → run file → cheat sheet.
Demo project rewritten with functional dispatch (no class/stdlib method
name lint issues). All frames clean — no ALE warnings, no git markers.
2026-04-22 17:45:52 +08:00
a42c980d3e perf: remove ttyfast, add grepprg/diffopt, DRY FZF commands, conditional tmux-navigator
- Remove deprecated `set ttyfast` (no-op since Vim 8)
- Add grepprg=rg for :grep → quickfix integration
- Add diffopt with histogram algorithm
- Consolidate Rg/RgWord/GFiles (24 lines → 10, lazy preview)
- Load vim-tmux-navigator only inside tmux, Ctrl+hjkl fallback outside
2026-04-22 17:06:33 +08:00
f6631dfdf1 docs: re-record demo GIF — deterministic FZF handling, all 6 scenes clean 2026-04-22 16:51:52 +08:00
56c3917682 perf+feat: fix logiPat guard, skip 2 more built-ins, add git/format bindings
Performance:
- Fix g:loaded_logipat → g:loaded_logiPat (0.478ms → 0.017ms)
- Skip openPlugin + manpager (12 built-in plugins disabled total)

Features:
- ,af toggle format-on-save
- ,gL git log --oneline --graph
- ,gC FZF commits search, ,gB buffer commits
2026-04-22 16:30:28 +08:00
996b428809 docs: re-record demo GIF — clean viminfo, fix ALE warnings 2026-04-22 16:18:21 +08:00
ba39fca13b docs: re-record demo GIF — 7-scene feature showcase 2026-04-22 15:54:33 +08:00
ecf0a1b260 docs: rewrite demo tape — 7-scene "what can I do" narrative
Scenes: vim . dashboard, fuzzy find, ripgrep, run file, sidebar
toggle, git status, cheat sheet. Optional LSP section commented out.
2026-04-22 15:53:30 +08:00
565f2fc80b docs: full README update — accurate keybindings, :ChopsticksStatus, lazy count fix
Some checks are pending
test / startup (macos-latest) (push) Waiting to run
test / startup (ubuntu-latest) (push) Waiting to run
test / shellcheck (push) Waiting to run
- Add :ChopsticksStatus to features table, LSP section, troubleshooting
- Add ,? cheat sheet, ,mp preview, toggle keys to keybinding reference
- Add missing bindings: [<Space>], ,E, ,gl, ,bd, ,cp, ,cf, ,wa, ,F, ,W
- Fix lazy-loaded count: 7 (not 6)
- Update architecture descriptions to match current modules
- Add health check section to QUICKSTART
- Add :ChopsticksStatus to cheat sheet sidebar
2026-04-22 15:25:40 +08:00
0686f9c6be feat: add :ChopsticksStatus diagnostic command and CHANGELOG
:ChopsticksStatus shows system tools, LSP servers, linters, and
formatters with OK/missing status. Helps new users discover what
to install without leaving Vim.
2026-04-22 15:21:35 +08:00
73a55e18e6 docs: fix plugin count (25), improve first-launch guidance, add :LspInstallServer to cheat sheet 2026-04-22 15:09:27 +08:00
0e92e6c1a8 feat: restore previm markdown preview (lazy-loaded, ,mp) 2026-04-22 14:57:55 +08:00
f8d45472dc docs: remove stale references to deleted features in QUICKSTART 2026-04-22 14:53:53 +08:00
fbb692846b ui: redesign cheat sheet — vertical sidebar, one key per line, aligned 2026-04-22 14:41:09 +08:00
51b10aa16d feat: restore ,? cheat sheet — lean version matching current keybindings 2026-04-22 14:35:45 +08:00
f6b6976bc0 fix(ci): lower plugin count threshold to match 24-plugin config 2026-04-22 14:33:07 +08:00
f43c8e5f0f Merge refactor/unix-minimalism: drop 565 lines, 5 plugins 2026-04-22 14:27:21 +08:00
5371521360 refactor: Unix minimalism — drop 565 lines, 5 plugins, 0 features that matter
Remove: Goyo, Limelight, previm, vim-obsession, indentLine (5 plugins).
Remove: cheat sheet function (90 lines), tutorial system (269 lines),
  ASCII art banner, tab management (8 keybindings), dead code (HasPaste,
  CleanExtraSpaces, ToggleNumber), spell nav bindings, scratch buffer,
  syntax stack debug, TTY startup message.
Fold: writing.vim → languages.vim (vim-markdown settings only).
Keep: everything that edits code — LSP, FZF, Git, ALE, netrw sidebar.
Result: 24 plugins, 949 lines, 19ms startup. No decorations, just tools.
2026-04-22 14:27:15 +08:00
b1746c72b7 Merge feature/ui-visibility: sidebar, statusline, toggle feedback 2026-04-22 12:52:34 +08:00
261b6cdce6 feat: UI visibility — sidebar toggle, enriched statusline, toggle feedback
- Netrw sidebar: ,e/,E toggles left-side tree (topleft + winfixwidth)
- vim . opens netrw sidebar (30 cols) + Startify dashboard
- Statusline: buffer count, PASTE/SPELL/MAX flags, LSP server, encoding
- Toggle echo: F2/F3/F4/F6/,ss/,z show new state
- README: fix empty table header in "What's in the box"
2026-04-22 12:52:31 +08:00
2e37efe644 feat: improve UI visibility and user interaction
Statusline: add buffer count, PASTE/SPELL/MAX flags, LSP server name,
encoding (shown only when non-utf-8/unix).

File tree sidebar: ,e toggles netrw sidebar (cwd), ,E toggles sidebar
(current file dir). Tracks t:netrw_sidebar_buf per-tab for reliable
toggle. browse_split=4 opens files in editor window.

vim . integration: opens tree sidebar (30 cols) + Startify dashboard.
Files opened from tree replace the dashboard.

Toggle feedback: F2/F3/F4/F6/,ss/,z now echo their new state.
2026-04-22 12:13:37 +08:00
97ca2be139 Fix shellcheck SC2012: use find instead of ls for plugin count
Some checks are pending
test / startup (macos-latest) (push) Waiting to run
test / startup (ubuntu-latest) (push) Waiting to run
test / shellcheck (push) Waiting to run
2026-04-22 01:02:18 +08:00
7b4b153f4b docs: GitHub polish — hero README, CI, templates, demo GIF
Add centered hero layout with demo GIF, 5 shields.io badges,
collapsible keybindings, performance table, and architecture tree.
Add GitHub Actions CI (startup test + shellcheck), issue/PR templates,
CONTRIBUTING.md, and VHS demo recording.
2026-04-22 00:58:56 +08:00
dbb11c9473 perf: 23ms → 19ms — drop vim-unimpaired, runtime tuning
Startup: replace vim-unimpaired (2.5ms) with 2-line blank line insertion.
29 plugins now. All [q/]q, [e/]e, [x/]x mappings were already ours.

Runtime:
- ALE lint_delay=200ms, echo_delay=100ms — less thrashing during edits
- LSP virtual_text_delay=200ms, highlight_delay=200ms, echo_delay=100ms
- Disable gitgutter default mappings (map_keys=0) — we don't use them
- Merge two BufReadPre large-file autocmds into one (single getfsize)
- Remove redundant filetype detection autocmds (Vim 9.2 handles natively)
2026-04-22 00:46:00 +08:00
f0d4431eef perf: 39ms → 23ms startup (40% faster)
- Guard against double-sourcing when exrc loads CWD .vimrc (saves ~8ms)
- Lazy-load EasyMotion, undotree, previm, goyo, limelight (on-demand)
- Lazy-load language syntax plugins (for: filetype)
- Enable lsp_settings_lazyload (defer server init to VimEnter)
- Skip unused built-in plugins (2html, gzip, tar, zip, vimball, etc.)
- Remove redundant filetype/syntax calls (plug#end already enables them)
- Add shortmess+=I to skip intro screen
2026-04-22 00:36:44 +08:00
fa59d5be8f docs: rewrite README and QUICKSTART — clean, short, for geeks
Cut README from 330 to 124 lines. No fluff, no repeated tables.
QUICKSTART is now a compact cheat sheet, not a tutorial.
Both point to the wiki for deep dives.
2026-04-22 00:21:15 +08:00
6044fc5fcb refactor: modular architecture — split .vimrc into 12 self-contained modules
Replace the monolithic 1268-line .vimrc with a thin loader that sources
12 modules under modules/ (env, plugins, core, ui, editing, navigation,
lsp, lint, git, writing, languages, tools). Each module is independently
readable and can be toggled by commenting one line.

Add interactive tutorial (tutor/chopsticks.tutor) with 10 lessons covering
all features. Users can run :ChopsticksLearn to start.
2026-04-22 00:05:10 +08:00
84d999f91f feat: major feature upgrade — zen mode, run file, smart search, and more
New plugins (3):
- vim-sleuth: auto-detect indentation from existing files
- goyo.vim + limelight.vim: zen mode for focused writing (,zen)

New built-in features (8):
- Run current file (,cr) — auto-detects Python/Go/Rust/JS/C/Shell/etc.
- Yank highlight — flashes yanked text for visual feedback
- Auto-clear search highlight after cursor stops moving
- Git conflict marker navigation ([x / ]x)
- Window maximize toggle (,z)
- Sudo save (:w!!)
- QuickFix auto-open + ]q/[q navigation
- ALE error/warning count in statusline

More FZF mappings:
- ,fh recent files, ,fl buffer lines, ,fL all lines
- ,fc commands, ,fm marks, ,f/ search history, ,f: command history

README rewritten with compelling feature showcase (30 plugins).
Cheat sheet and QUICKSTART updated with all new features.
2026-04-21 23:42:41 +08:00
cc328cebf2 fix: round 2 — completion speed, octal numbers, dead files
- Reduce asyncomplete popup delay 200ms→50ms for snappier completion
- Add nrformats-=octal: Ctrl-A on 007 now goes to 008, not 010
- Add formatoptions+=j: joining comment lines removes duplicate leaders
- Remove coc-settings.json (vestigial, CoC not used)
- Fix .gitignore: was blocking all *.json files unnecessarily
- Update README: Python LSP is pylsp only (pyright removed)
2026-04-21 23:32:59 +08:00
575ff2c489 fix: comprehensive bug audit — 14 fixes for performance and usability
Critical bugs:
- Statusline colors never applied on startup (SLDefineColors called after colorscheme)
- noremap 0 ^ broke operator-pending mode (d0, c0, y0 all wrong)
- Two Python LSPs running simultaneously (pyright requires Node.js)
- asyncomplete_auto_completeopt=1 overriding completeopt settings
- ALE/vim-lsp diagnostic overlap (tsserver, gopls duplicated)
- Ctrl-s in insert mode shifted cursor right by one
- Startify buftype= clearing made buffer writable

Performance & usability:
- Switch to vim-solarized8 (proper termguicolors, maintained)
- Add ale_disable_lsp=1 for clean ALE/vim-lsp coexistence
- Remove redundant gofmt from Go fixers (goimports is superset)
- Add isort --profile black for formatter compatibility
- Remove dead godef references (unmaintained since 2020)
- Set lazyredraw globally, tw=0 default
- Remove vestigial coc-settings.json symlink from install.sh
2026-04-21 23:28:59 +08:00
4fb20177ef
Fix Previm browser opener
Configure Previm to open Markdown previews via /usr/bin/open on macOS, with an xdg-open fallback for Linux desktop environments.
2026-04-15 17:47:19 +08:00
5604eddbdb fix: remaining usability and design improvements
.vimrc:
- Remove path+=** (hangs on large repos with node_modules)
- Add plugin guards for FZF, Git, ALE, Markdown, EasyMotion, UndoTree
  mappings (prevent E492 when plugins not loaded)
- Replace SmartFiles system() subprocess with isdirectory/finddir
  (no more synchronous fork on every Ctrl+p)
- Remove duplicate SLDefineColors VimEnter call (ColorScheme alone suffices)
- Convert all remaining nmap/map to nnoremap/noremap (eliminate recursive
  mapping risk and visual/operator-pending mode contamination)
- Expand cheat sheet with spell checking, utilities, window resize,
  F-key toggles, EasyMotion line motions, buffer management

get.sh:
- Support NO_COLOR and non-TTY output
- Show version tag or commit hash after clone/pull

QUICKSTART.md:
- Warn about first-launch plugin install (30-60s wait)
- Note that some language servers need Node.js
2026-04-15 10:15:07 +08:00
233ceabf53 fix: usability and design improvements across .vimrc, install.sh, README
.vimrc:
- Remove global eventignore+=FileType corruption in large file handler
- Add t_8f/t_8b for tmux true color support
- Fix vnoremap J/K shadowing built-in J (join); use Alt+j/k in visual mode
- Replace map with nnoremap for buffer/tab/spell/misc mappings (prevents
  visual/operator-pending mode contamination)
- Change BufEnter to FileType for formatoptions (fires less frequently)
- Remove duplicate whitespace trim (ALE already handles it via fix_on_save)
- Guard <leader>so to only source vim files
- Guard <leader>cp/<leader>cf with has('clipboard')
- Add completeopt=popup for floating completion docs (Vim 8.1.1517+)
- Change Startify header from "MINGSAMA" to "chopsticks"
- Make Startify bookmarks conditional (only show shell rc files that exist)
- EasyMotion <Leader>j/k: map → nmap (prevent visual mode leak)
- Move-line: nnoremap instead of nmap for normal mode variant

install.sh:
- Add --help flag
- Support NO_COLOR and non-TTY output (no ANSI codes when redirected)
- Include $BASH_COMMAND in ERR trap for better debugging
- Use mktemp for secure temp files instead of predictable /tmp paths
- Warn user when pip falls back to --break-system-packages

README:
- Add missing mappings: jk, F2-F6, gV, //, ,ev, ,sv, ,cp, ,cf, ,*, ,F, ,W, ,ms, ,ss
- Note that some language servers require Node.js even though vim-lsp doesn't
- Clarify Alt+j/k works in both normal and visual mode
2026-04-15 10:08:10 +08:00
0ba2e84e0c fix: correct 13 bugs across .vimrc, install.sh, and docs
.vimrc:
- Fix syntax=OFF no-op in large file handler (syntax= is correct)
- Fix <leader>rG broken -F flag (new RgWord command with -F before --)
- Fix :Gdiff → :Gdiffsplit (fugitive v3+ compat)
- Fix go_def_mode/go_info_mode conflicting with go_gopls_enabled=0
- Fix <leader>m prefix collision with mt/mp (renamed to <leader>ms)
- Wrap PlugInstall autocmd in augroup (prevent doubling on re-source)

install.sh:
- Guard against empty version string in hadolint/marksman downloads
- Add HAS_SUDO check in _do_binary_apt before sudo mv
- Add PlugClean warning when existing plugins directory is non-empty
- Fix pkg_install brew-first priority (macOS-only now, Linux fallback)
- Fix menu double-draw flicker on first render
- Fix Fedora deselected tools not tracked in SKIPPED array

docs:
- Remove nonexistent nvm install step from README
- Fix TOC description (side window, not quickfix) in README/QUICKSTART
- Fix TTY detection description (add dumb, empty, builtin)
- Add missing ,cd and ,wa mappings to README
- Remove dead CoC formatOnSaveFiletypes from coc-settings.json
2026-04-15 09:57:26 +08:00
0b3f631e98 fix: correct non-TTY vim-plug install; add real plugin count check
- _vim_run non-TTY branch: remove </dev/null (caused "Error reading
  input, exiting" before downloads finished → 0 plugins installed) and
  >/dev/null (broke async job callbacks → partial install of ~13/26).
  Now only redirects stderr; stdin inherits from caller so vim's event
  loop runs to completion.
- Add post-install verification: count ~/.vim/plugged entries and die
  if empty, replacing the unconditional "ok Plugins installed" that
  masked failures silently.
- .vimrc, install.sh, QUICKSTART.md, README.md: carry forward the full
  v1.2 rewrite (checkbox module selection, solarized palette, LSP
  stack) that accumulated in the previous session.

Tested: macOS (27 plugins, exit 0) and Arch Linux SSH (26 plugins,
exit 0). shellcheck: zero warnings.
2026-04-10 18:43:52 +08:00
716e7e5808 fix: silence fzf post-install hook false-positive exit code 2026-04-09 22:57:42 +08:00
a605185a2e fix: use TERM=dumb+/dev/null for non-interactive vim runs, eliminating escape sequence leakage 2026-04-09 22:53:53 +08:00
4a9c9354a2 fix: restore original art header as static list (no system() call) 2026-04-09 22:49:52 +08:00
b2b1632857 fix: terminal garble, black screen on startup, Unicode in header
.vimrc:
- TTY detection: add empty($TERM) and dumb — fixes black screen when
  TERM is unset (non-interactive SSH, minimal environments)
- Replace StartifyHeader() with a static ASCII list — removes the
  synchronous system('git ...') call that caused the black screen while
  vim waited for git before rendering, and removes Unicode block chars
  (███╗) that rendered as garbage on terminals without full UTF-8

install.sh:
- _vim_run() helper: uses </dev/tty when accessible so vim properly
  manages the alternate screen buffer and restores terminal state on
  exit — this was the root cause of garbled output after PlugInstall
  and CocInstall steps; falls back to --not-a-term for CI environments
- Remove 'screen may go dark' warning — no longer needed since terminal
  state is properly managed via /dev/tty

Remove CHANGELOG.md — use git log
2026-04-09 22:48:55 +08:00
b20bedaa8b docs: update README, QUICKSTART, CHANGELOG for v1.2.0
- README: one-liner curl install as primary method, updated Requirements
  table to reflect auto-install capability, expanded Installation section
  with 11-step installer description
- QUICKSTART: Step 1 now leads with curl one-liner, includes traditional
  and --yes variants
- CHANGELOG: add v1.2.0 entry covering all robustness and get.sh changes
2026-04-09 22:37:07 +08:00
8820d1d107 fix: use test-open for /dev/tty instead of -e check
[[ -e /dev/tty ]] returns true even in non-interactive SSH sessions
where the device file exists but cannot actually be opened, causing
'No such device or address' errors. Replace with { true </dev/tty; }
which tests actual openability before redirecting.
2026-04-09 22:32:04 +08:00
825633d623 feat: robust installer with preflight checks, one-command get.sh
install.sh:
- set -eo pipefail + trap ERR with line number and debug hint
- Network connectivity check before any downloads
- curl and git preflight: auto-install or die with clear instructions
- vim auto-install attempt before dying
- sudo availability check (one-time auth, graceful skip when unavailable)
- macOS: offer to install Homebrew if missing
- Node.js: offer nvm install if missing (with fallback to vim-lsp)
- Python3: offer install if missing
- ask() reads from /dev/tty — interactive prompts work under curl | bash
- safe_download(): verifies file non-empty and not an HTML error page
- pkg_install(): unified cross-platform helper (brew/apt/pacman/dnf)
- arch_github()/arch_linux_x64(): normalize uname -m (handles aarch64)
- Temp files cleaned up via EXIT trap
- Symlink creation verified after ln -sf
- vim-plug: fallback to git clone if curl fails; verify file non-empty
- vim +PlugInstall: warn on failure instead of silent continue
- Binary downloads (hadolint, marksman) use named temp files

get.sh (new):
- One-command bootstrap: curl | bash
- Installs git if missing
- Clones repo to ~/.vim (or git pull if already present)
- exec bash install.sh </dev/tty so interactive prompts work correctly
2026-04-09 13:59:30 +08:00
e3877edaeb docs: add CHANGELOG entry for v1.1.1
Documents the 15 best-practice settings absorbed from top global vim
configs (amix, tpope/vim-sensible, ThePrimeagen, YADR, spf13) that
were committed in the previous release but missing from the changelog.
2026-04-09 13:41:45 +08:00
74071f7464 feat: absorb 15 best practices from top global vim configs (amix, tpope, ThePrimeagen, YADR, spf13)
Settings (vim-sensible / community consensus):
- set ttimeoutlen=10 — eliminates ESC lag in terminal Vim
- set display+=lastline — show truncated last line instead of @@@
- set complete-=i — faster Ctrl+n/p by not scanning included files
- set wildignorecase — case-insensitive filename completion
- set path+=** — recursive :find with wildignore exclusions
- set sessionoptions — clean session saves without stale plugin options
- Expand wildignore: node_modules, __pycache__, dist, build

Visible whitespace:
- set listchars (TTY: ASCII; GUI: Unicode symbols) — F6 to toggle

Line-length guides (textwidth + colorcolumn=+1):
- Python: 88, Go: 120, JS/TS: 100, Rust: 100, Shell: 80
- Markdown: no limit (colorcolumn=0), all others via +1

Autocmds:
- ChopstickFormatOptions: formatoptions-=cro on BufEnter (disables
  auto-comment-continuation — universally desired, overrides filetype plugins)
- ChopstickPaste: InsertLeave → set nopaste (prevents broken indent)

Key mappings:
- vnoremap J/K — move selected lines with =gv re-indent (ThePrimeagen)
- gV — reselect last pasted text (`[v`] — spf13, YADR)
- cnoremap Ctrl+p/n — command history navigation (amix, spf13)
- <leader>e — :Explore (built-in file browser, plugin-free fallback)
- <leader>cd — lcd to current file's directory (was: cd, now window-local)
- F6 — toggle visible whitespace
- <leader>sv — reload vimrc with confirmation echo
2026-04-09 12:43:47 +08:00