Skip to content

Consider splitting zsh functions.zsh into category-based files #104

@joshukraine

Description

@joshukraine

Problem

The current zsh/.config/zsh/functions.zsh file has grown to ~630 lines and contains many different types of functions, making it harder to navigate and maintain at a glance.

Current State

  • Zsh: Single functions.zsh file with all functions
  • Fish: Individual files per function (easier to manage/find)
  • Documentation: We have generated docs that reflect the functions

Proposed Solution

Split functions.zsh into category-based files:

  • git-functions.zsh - Git workflow functions (gcom, gpum, grbm, gll, etc.)
  • directory-functions.zsh - Navigation and directory utilities (path, cdot equivalents, etc.)
  • utility-functions.zsh - General utilities (fs, dsx, pi, etc.)
  • development-functions.zsh - Development-specific functions (ct, startpost, etc.)
  • abbreviation-functions.zsh - Abbreviation management (reload-abbr)

Considerations

Pros

  • ✅ Easier to find and maintain specific functions
  • ✅ Better organization and discoverability
  • ✅ Cleaner git history per function category
  • ✅ Matches the granular approach used in Fish

Cons

  • ⚠️ Need to update .zshrc to source multiple files
  • ⚠️ Slight increase in shell startup time (multiple file reads)
  • ⚠️ More complex than current single-file approach

Implementation Notes

Would need to:

  1. Split functions by logical category
  2. Update zsh/.zshrc to source all category files
  3. Maintain existing function documentation standards
  4. Ensure no breaking changes to function availability

Priority

Low priority - current system works fine, this is a quality-of-life improvement for maintenance.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions