Commit graph

130 commits

Author SHA1 Message Date
d3a137a36e Align docs with expert Vim workflow 2026-05-24 09:02:50 +08:00
a6a101a286 Update checkout action for Node 24 2026-05-23 23:25:43 +08:00
fd29dd160e Add local config commands 2026-05-23 20:00:00 +08:00
0b1c8d94d7 Add native Vim help entrypoint 2026-05-23 19:48:15 +08:00
a4ea56525f Add beta documentation consistency check 2026-05-23 19:38:48 +08:00
87719ebdd3 Add in-editor beta guide 2026-05-23 19:27:01 +08:00
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
74cc479a0e
Insulate vim smoke tests from a user's local chopsticks.vim (#73)
Four `vim -u NONE` invocations in scripts/test.sh set a profile or
option as their first `-c` then `source .vimrc`. They didn't override
XDG_CONFIG_HOME, so .vimrc's local-config hook read
~/.config/chopsticks.vim and any `let g:chopsticks_profile = '...'`
there silently overrode the test's setup.

After install.sh runs (writing `engineer` or `full` to that file),
scripts/test.sh vim fails on the developer's machine but passes in
CI — CI never runs install.sh.

Fix by prepending XDG_CONFIG_HOME="\$EMPTY_XDG" to the four bare sites,
matching what the surrounding tests already do. L176 stays unchanged
because it explicitly sets g:chopsticks_local_config to its own
controlled file.

Closes #72
2026-05-17 09:39:12 +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
8a36b41d66
Clarify the "no Node.js dependencies" rule (#71)
The original rule was easy to misread as "no npm tools anywhere",
which conflicts with install.sh installing prettier/eslint/etc. The
real boundary is the Vim runtime: no coc.nvim or Node-backed
completion engines. External CLIs that ALE shells out to are fine.

Update the README pointer line to match.

Closes #70
2026-05-16 22:59:40 +08:00
8e6dcc6e97
Fix opt-in keymap install messaging (#61)
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-13 18:28:31 +08:00
2514d2e803
Fix noninteractive plugin installation (#59) 2026-05-13 18:22:12 +08:00
b2835d3cae
Make terminal keymaps opt-in (#57) 2026-05-13 17:24:45 +08:00
23f6ed98ec
Make auto-pairs opt-in (#55) 2026-05-13 17:18:01 +08:00
043e8e4a58
Make completion keymaps opt-in (#53) 2026-05-13 17:08:21 +08:00
8f89939a57
Make sudo-save mapping opt-in (#51) 2026-05-13 15:47:59 +08:00
ea8c3054e1
Move visual selection search to leader mapping (#49) 2026-05-13 15:01:45 +08:00
2aa28304ca
Restore command-line Ctrl-P and Ctrl-N (#47) 2026-05-13 14:50:27 +08:00
ff0de570de
Move last-change selection to leader mapping (#45) 2026-05-13 14:44:58 +08:00
fd081a2397
Make Ctrl-S save opt-in (#42)
* Make Ctrl-S save opt in

* Avoid hanging CI Vim installation

* Keep Homebrew Vim on macOS CI
2026-05-13 14:32:50 +08:00
76aa3efd72
Make jk escape opt in (#40) 2026-05-13 14:05:22 +08:00
f278e9f3b6
Restore native Ctrl window keys (#38) 2026-05-13 13:56:28 +08:00
d03f7129d8
Move file search to leader mapping (#36) 2026-05-13 13:50:27 +08:00
e1c2ea3888
Restore native Space motion behavior (#34) 2026-05-13 13:39:59 +08:00
861e18b86c
Restore native Q behavior (#32) 2026-05-13 13:32:35 +08:00
8e2505bfca
Restore native Y yank behavior (#30) 2026-05-13 13:28:21 +08:00
49aae12415
Restore native zero motion (#28) 2026-05-13 13:24:04 +08:00
2f7d488c8c
Move LSP navigation to native-first mappings (#26) 2026-05-13 13:18:08 +08:00
5544b74545
Improve first-time LSP setup guidance (#25) 2026-05-13 12:45:53 +08:00
c98d04200c
Document native-first keymap policy (#23) 2026-05-13 12:39:40 +08:00
9fde301a2c
Use temp output for C file runner (#21) 2026-05-13 12:39:08 +08:00
097c8abcd7
Report LSP status without autoload false negatives (#20) 2026-05-13 12:38:32 +08:00
1c54077487
Make bootstrap dry-run avoid git installation (#19) 2026-05-13 12:37:46 +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