Contributing to zsh-smart-insert
April 20, 2025 ยท View on GitHub
Thank you for your interest in contributing to zsh-smart-insert! ๐
This project aims to improve Zsh productivity with file-aware command insertion using fzf, fd, and ripgrep, while keeping the experience ergonomic and extensible.
๐ How to Contribute
-
Fork this repository
-
Clone your fork:
git clone https://github.com/lgdevlop/zsh-smart-insert.git -
Create a new branch:
git checkout -b feature/my-contribution -
Make your changes
-
Submit a Pull Request to the
mainbranch
๐ Types of Contributions
We welcome contributions of all kinds:
- ๐ Bug fixes
- โก Performance or compatibility improvements
- ๐งฉ New search strategies or integrations
- ๐ Improvements to documentation or examples
- ๐ฎ UX enhancements and new keyboard shortcuts
๐งช Coding Standards
- Use idiomatic Zsh syntax for all plugin logic
- Comment code clearly in English
- Use descriptive variable names (e.g.,
LBUFFER,prefix,selected_file) - Prefer readability and testability in logic
- Test widget behavior inside real interactive terminals
โ Test Checklist
Before submitting your PR:
- The plugin loads without errors via
zsh-smart-insert.plugin.zsh - Widgets behave correctly (
Alt+f,Alt+g,Alt+s) - Prefix selection and path injection are functional
- Previews (
bat) and livefzfreloads work as expected - No new warnings or regressions in functionality
๐ฆ Project Structure
.
โโโ zsh-smart-insert.plugin.zsh # Plugin entry point
โโโ internal/ # Interactive widgets (fzf, rg, etc.)
โโโ functions/ # Reusable utility functions
โโโ project-docs/ # Markdown docs (examples, shortcuts)
โโโ install.sh # Interactive CLI installer
โโโ scripts/ # Local automation (e.g., release notes)
โโโ Makefile # CLI tasks for install/test/reload
โโโ assets/ # Optional logos or visual assets
โ๏ธ Commit Guidelines
This project uses Gitmoji Commit Workflow.
Please refer to COMMITS.md for types, emojis, and formatting rules.
Format:
โจ feat(scope): support plugin previews
๐ Execution Permissions & Shebang Rules
To keep the repository clean and predictable, follow these rules regarding file permissions and shebang usage:
โ
Executable files (require +x and shebang)
| File | Shebang | Description |
|---|---|---|
install.sh | #!/usr/bin/env zsh | Interactive installer |
scripts/*.js | Optional (node CLI) | Node-based tooling (CI scripts) |
โ Non-executables (no +x, no shebang)
| File | Why |
|---|---|
zsh-smart-insert.plugin.zsh | Source-only plugin entry |
functions/*.zsh | Utility shell functions |
internal/*.zsh | Widget logic (fzf_*) |
project-docs/*.md | Markdown documentation |
.changeset/*.md | Versioning metadata |
๐ Recommended command to clean up permissions
# Remove +x from non-executable files
find functions internal project-docs .changeset -type f \( -name '*.zsh' -o -name '*.md' \) -exec chmod -x {} \;
chmod -x zsh-smart-insert.plugin.zsh
# Add +x to true executable scripts
chmod +x install.sh
chmod +x scripts/*.js
๐ก๏ธ Code of Conduct
Please read our Code of Conduct. By contributing, you agree to follow it.
Thank you for helping improve zsh-smart-insert ๐