I’m sure some of you have absolute monstrosities of sigils (I know I do, in my .zshrc alone). Post them without context, and try and guess what other users’s lines are. If you want to provide context or guess, use the markdown editor to spoiler-tag your guesses and explanations!

  • GammaOPM
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    I’ve written multiple Zsh plugins, so I’ve gotten familiar with a lot of Zsh’s features. I’ve probably read every line in man zshexpn twice by now having referenced it so much.

    Zsh expansions can look gnarly because parameter expansion forms can be nested. Where Bash has to do:

    tmp=${foo%$suffix}
    len=${#tmp}
    

    Zsh can do it in one:

    len=${#${foo%$suffix}}
    

    Once you add PE forms which don’t exist in Bash, parameter expansion flags, array subscript flags, globbing qualifiers and modifiers, you can get something which looks absolutely unreadable.