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

  1. Fork this repository

  2. Clone your fork:

    git clone https://github.com/lgdevlop/zsh-smart-insert.git
    
  3. Create a new branch:

    git checkout -b feature/my-contribution
    
  4. Make your changes

  5. Submit a Pull Request to the main branch


๐Ÿ“‚ 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 live fzf reloads 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)

FileShebangDescription
install.sh#!/usr/bin/env zshInteractive installer
scripts/*.jsOptional (node CLI)Node-based tooling (CI scripts)

โŒ Non-executables (no +x, no shebang)

FileWhy
zsh-smart-insert.plugin.zshSource-only plugin entry
functions/*.zshUtility shell functions
internal/*.zshWidget logic (fzf_*)
project-docs/*.mdMarkdown documentation
.changeset/*.mdVersioning metadata
# 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 ๐Ÿ’š