Fish Shell Conventions
File Organization (in SMS repo: fish/.config/fish/)
- •
conf.d/-- Config snippets loaded alphabetically; use numeric prefixes (00-, 20-, 50-) to control order - •
functions/*.fish-- Autoloaded functions (one function per file, name must match filename)
Scripting Rules
- •Use
set -gxfor global exports,set -lfor local vars - •Prefer
stringbuiltins over sed/awk for string manipulation - •Use
fish_add_pathinstead of manually editing PATH - •No POSIX-isms: no $(), no &&/||, use
and/or/; and
Testing
- •
fish --no-execute <file>to syntax-check without running - •
fish_indentto format fish scripts