Commit graph

30 commits

Author SHA1 Message Date
c5f84a700d Prepare v3 beta candidate docs 2026-05-23 18:08:31 +08:00
3f967af8e4 Prepare v3 ergonomic Space keymap candidate 2026-05-21 12:54:13 +08:00
f38bdf6e57 Revert "Release v3.0.0 ergonomic keymap"
This reverts commit d56ca80da7.
2026-05-21 12:02:55 +08:00
d56ca80da7 Release v3.0.0 ergonomic keymap 2026-05-21 11:50:32 +08:00
e5412e464e
Cut 2.2.0 (#83)
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
test / docs (push) Has been cancelled
Promote the Unreleased changelog section to 2.2.0 and leave a fresh
Unreleased placeholder above it. No code changes.

Highlights of this release:
- Six default behaviors moved to opt-in flags: exrc/secure, normal-mode
  ,F reindent, jk escape, Ctrl-S save, sudo-save, completion keymaps,
  auto-pairs, terminal keymaps.
- install.sh: interactive PlugClean (no longer silently nukes
  user-added plugins), pipx-first Python tool install (no more
  silent --break-system-packages on PEP 668 distros), interactive
  profile selection, --dry-run / --configure-only flags.
- ttimeoutlen tuned to 50ms on SSH/TTY (was 10ms unconditionally).
- Built-in plugin guards corrected: gzip/logiPat/rrhelper/spellfile
  needed unscoped loaded_X form, not g:loaded_X.
- get.sh: hardened bootstrap (refuses non-chopsticks repos, dry-run
  is side-effect-free, CHOPSTICKS_DEST for non-default install path).
- :ChopsticksStatus diagnostic command, profile-aware ,? cheat sheet,
  scripts/test.sh shared by CI and local maintainers.
- README/install.sh now state Vim 8.1+ accurately; install summary
  leads with ,? as the first onboarding hint.
2026-05-17 14:30:47 +08:00
7f7a200b85
Fix built-in plugin guards for old-style runtime plugins (#82)
env.vim sets g:loaded_X for twelve built-in plugins to short-circuit
them. A prior fix corrected the casing on g:loaded_logiPat, but four
of those plugins actually check the unscoped loaded_X form, not
g:loaded_X — so those four guards have been doing nothing.

Affected (all old runtime plugins predating the g:loaded_ convention):

- gzip.vim       checks `loaded_gzip`
- logiPat.vim    checks `loaded_logiPat`
- rrhelper.vim   checks `loaded_rrhelper`
- spellfile.vim  checks `loaded_spellfile_plugin`

Set both forms (g: and unscoped) for those four — belt and
suspenders. Empirically saves ~270μs at startup, mostly from gzip
which was loading its full autocmd group on every launch.

Add a regression assertion: source .vimrc, verify the four unscoped
guards exist.

Closes #81
2026-05-17 14:08:20 +08:00
f0c662fd5c
Sweep stale Ctrl+P references after native-first cleanup (#80)
PR #36 rebound fuzzy-find from Ctrl+P (native command-line history)
to ,ff, but four user-facing sites still told people to press Ctrl+P:

- install.sh interactive menu (ripgrep description, fzf description)
- QUICKSTART.md "Find things" block
- .github/demo.tape (the script that regenerates the README hero GIF)

Three text fixes; the .tape update keeps a future regenerate honest.
The binary .github/demo.gif still shows Ctrl+P — regenerating it
requires the original /tmp/demo-project fixture which isn't in repo,
so that's left for a follow-up.

Closes #79
2026-05-17 13:31:36 +08:00
fc5cac570e
Bump ttimeoutlen to 50ms on SSH/TTY (#75)
* Bump ttimeoutlen to 50ms on SSH/TTY

ttimeoutlen=10 fragments multi-byte key codes (F-keys, arrows, Alt-
prefixes) when one-way latency exceeds 10ms, which is normal on SSH.
Vim then sees ESC followed by a literal letter and either returns to
Normal mode mid-insert or treats the trailing byte as a separate
keypress (so <F4> inserts "4").

50ms is the standard "slow link" value: well below perceptible <Esc>
delay locally and big enough for typical residential/long-haul SSH.
g:is_tty already gates several other terminal accommodations; reuse
it here.

Closes #74

* Pin TERM in ttimeoutlen test (env-hermetic)
2026-05-17 12:54:24 +08:00
5156543702
Bump Vim version docs to 8.1+ and lead onboarding with ,? (#78)
Two small first-run UX fixes bundled together (both touch install.sh
and README, with the same review surface):

1. README badge and install.sh warn line bumped 8.0+ → 8.1+. The
   runtime conditionally relies on patches 8.1.0360 (diffopt) and
   8.1.1517 (completeopt+=popup). Guards no-op on 8.0 but the docs
   were silently misleading anyone debugging on stale Vim.

2. "First steps inside Vim" block reordered so ,? leads. The cheat
   sheet is the most useful onboarding asset; it shouldn't be buried
   below three "how to leave" hints. Also promoted ,x above :q!
   since the latter is emergency, not first-run.

Closes #76
Closes #77
2026-05-17 11:00:03 +08:00
debcdd33c4
Prefer pipx over pip3 --break-system-packages for Python tools (#67)
The previous fallback chain (pip3 install → pip3 install
--break-system-packages) silently writes into the distro Python's
site-packages on PEP 668 systems (Debian 12+, Ubuntu 23.04+). The warn
message fires after the damage is done. Since the target audience is
engineers SSH-ing into Linux servers, the PEP 668 hit rate is high.

New order:
  1. pipx install   (isolated per-tool venvs)
  2. pip3 --user    (works on pre-PEP-668 Python)
  3. --break-system-packages  (gated behind CHOPSTICKS_ALLOW_BREAK_SYSTEM=1)
  4. fail with a remediation hint

Also:
- Bootstrap pipx via the system package manager if it's missing.
- Warn if $HOME/.local/bin is absent from PATH (pipx and pip --user
  both install there).

Closes #66
2026-05-17 08:42:52 +08:00
d6df4fee3e
Make PlugClean interactive in install.sh (#65)
Previously install.sh ran `_vim_run 'PlugClean!'` unconditionally before
PlugInstall. PlugClean with bang removes any directory under
~/.vim/plugged not declared in the active profile's g:plugs, without
confirmation — silently nuking plugins a user has manually cloned to try
out, plus leftovers from older profile config (Goyo, Limelight, etc.).

Replace with a `list_extra_plugins` helper that runs a Vim subprocess
with all opt-in flags forced on and `$TMUX = '1'`, so the declared set
covers every plugin any chopsticks profile/flag combination could
register. Conditional plugins (vim-tmux-navigator, auto-pairs) are
therefore never flagged as extras.

When extras are detected:
- interactive: list them, ask before running PlugClean!
- --yes: leave in place, instruct the user to run :PlugClean manually
- otherwise (no extras): skip PlugClean entirely (saves an 80ms Vim
  launch on the common case)

Closes #64
2026-05-17 08:38:35 +08:00
002bc7bd3e
Make ,F full-file reindent opt-in (#69)
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
test / docs (push) Waiting to run
`,F` in normal mode mapped `gg=G\`\`` — reindent the entire file with
no confirmation. A muscle-typo of `,F` instead of `,f` (LSP format)
rewrites the whole buffer, and `=` does not always produce sensible
indentation for languages where Vim's internal indent expression is
poor.

Gate the normal-mode binding behind `g:chopsticks_enable_reindent_file`
(default off). The visual-mode binding (`vnoremap <leader>F =`) is
bounded by the user's selection and stays as default.

README's all-keybindings table now marks `,F re-indent (v)` to reflect
the visual-only default.

Closes #68
2026-05-16 23:08:26 +08:00
fc872918a1
Make project-local exrc opt-in (#63)
`set exrc` causes Vim to source `.vimrc`/`.exrc` from the current
working directory, which is a wider blast radius than the default
should accept for a config aimed at SSH/shared-host workflows.
`set secure` mitigates the most dangerous behaviors but still allows
arbitrary buffer state changes from an untrusted CWD.

Gate both behind `g:chopsticks_enable_exrc` (default off), following the
existing opt-in convention used for jk escape, Ctrl-S save, auto-pairs,
terminal keymaps, and completion keymaps.

Closes #62
2026-05-16 23:00:44 +08:00
259744b5e3 Improve test runner discoverability
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
test / docs (push) Has been cancelled
2026-05-05 01:17:30 +08:00
67ffdfe99f Add reusable project test runner 2026-05-05 00:31:12 +08:00
1b9e8b3999 Add bootstrap dry-run safety checks
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
test / docs (push) Waiting to run
2026-05-04 11:49:20 +08:00
ddb4c691b9 Add installer dry-run and configure-only modes
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
test / docs (push) Waiting to run
2026-05-03 23:40:01 +08:00
d253583d0b Improve installer profile handling and validation 2026-05-03 23:23:21 +08:00
7ff5326932 Make Vim help profile aware 2026-05-03 23:23:21 +08:00
a9e16d22d3 Respect profiles in local config and status 2026-05-03 23:23:21 +08:00
db9b96f577 Refine Vim defaults and add profiles 2026-05-03 23:23:21 +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
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
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
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
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
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
23ad2e5b7a feat: ergonomics overhaul, tmux integration, and beginner onboarding (v1.1.0)
Keybindings:
- Add jk → Esc in insert mode (ergonomic escape)
- Add Ctrl+s save in normal and insert mode
- Add // visual search (very-nomagic escaped)
- Add <leader>p/P clipboard paste
- Add <leader>rG ripgrep word under cursor (-F literal)
- Add <leader>u / <leader>tt as leader aliases for F5/F8
- Fix ALE [e/]e navigation direction (was reversed)
- Remove dead <C-h/j/k/l> maps (owned by vim-tmux-navigator)
- Remove <leader>pp (duplicate of F2, caused 500ms delay on <leader>p)

Plugins:
- Add vim-tmux-navigator for seamless Vim/tmux pane navigation
- Fix <leader>rG: pass -F so regex metacharacters don't corrupt matches
- Fix LargeFileSettings: disable ALE for files >10MB

In-Vim UX:
- Add ,? cheat sheet (read-only buffer, q to close)
- ALE lint triggers: normal/enter/insert-leave now active

install.sh:
- Add tmux.conf auto-configuration step with C-l warning
- Add post-install survival guide for first-time Vim users

Docs:
- README: full badge row (release, stars, issues, last-commit, PRs, plugins, languages)
- README: Contributing section with bug/PR guidelines
- QUICKSTART: Step 0 — Vim modes and 4 survival commands for beginners
- CHANGELOG: v1.1.0 entry
2026-04-09 12:20:10 +08:00
3236155b84 docs: comprehensive v1.0.0 documentation update
- README: full rewrite — updated language table (staticcheck, yamllint,
  hadolint, marksman via coc-settings.json), install.sh platform coverage,
  removed coc-marksman references, added CHANGELOG link
- QUICKSTART: rewrite to reflect automated install.sh, updated language
  workflows (staticcheck for Go, marksman for Markdown)
- CHANGELOG: new file documenting v1.0.0, v0.9.0, and v0.1.0 releases
- .gitignore: add *.swp, *.swo, .DS_Store, Session.vim
2026-03-29 18:05:51 +08:00