zsh: drop sed for regexp-replace and use zstyle to avoid hardcoding things in a script

2026-04-141 minWesley Schwenglezshregexp-replacereplacesedzstyleregexpcoding

Zsh has regexp-replace, you don’t need sed:

zsh
autoload regexp-replace
regexp-replace line '^pick' 'f'

Also, instead of hard coding values, use zstyle:

zsh
# in your .zshrc
zstyle ':xyz:xyz:terminal' terminal "kitty"

# in your script/function
local myterm
zstyle -s ':xyz:xyz:terminal' terminal myterm || myterm="Eterm"