mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-06-26 05:44:38 +08:00
2.1 KiB
2.1 KiB
Contributing
Rules
- No Node.js in the Vim runtime. Plugins must work with pure VimScript — no coc.nvim or other Node-backed completion engines. External CLIs (prettier, eslint, markdownlint, stylelint, tsc) installed via npm are fine; ALE shells out to them as optional system tools, not as part of the Vim runtime.
- Startup matters. Run
vim -u .vimrc -i NONE --startuptime /tmp/s.log -es -N -c qa!before and after. If your change adds >1ms, it needs a good reason. - Works on TTY. Test over SSH. If it breaks in a terminal without true color, fix it or gate it behind
g:is_tty. - Native-first keymaps. Enhance Vim's native behavior instead of replacing it. Do not override built-in motions, operators, text objects, or help-oriented keys for discoverability alone. Rare exceptions, such as the default Space-layout
sjump, must have a documented native replacement, cheat-sheet coverage, and a classic-layout fallback. - One module, one concern. Don't put git config in lsp.vim.
Adding a plugin
- Add the
Plugline tomodules/plugins.vim - If it's not needed at startup, lazy-load it:
Plug 'foo/bar', { 'on': 'FooCommand' } - Put config in the appropriate module
- Check new mappings against native Vim behavior before adding them
- Update the cheat sheet definitions in
modules/cheatsheet.vimif you add keybindings - Run
scripts/test.sh vimlocally after installing plugins - Test on both macOS and Linux when changing terminal or package-manager behavior
Local tests
scripts/test.sh --help
scripts/test.sh quick
scripts/test.sh vim
scripts/test.sh quick runs shell, docs, installer, and bootstrap checks without requiring Vim plugins.
scripts/test.sh vim expects plugins to be installed under ~/.vim/plugged.
Use STARTUP_LIMIT_MS=150 scripts/test.sh vim to match CI's startup threshold.
Reporting bugs
Open an issue. Include:
- OS and Vim version
- Whether you're on SSH/TTY
- Steps to reproduce
Code style
- Named augroups with
autocmd! - No comments explaining what — only why
exists('g:plugs["..."]')guards for plugin-dependent config- Test with
scripts/test.sh vim