AndydeCleyre / zpy

Zsh helpers for Python venvs, with uv or pip-tools
https://zpy.rtfd.io/
The Unlicense
78 stars 1 forks source link

Make use of zsh/mapfile to avoid more subshells #24

Closed AndydeCleyre closed 5 months ago

AndydeCleyre commented 10 months ago

To find candidates for changing, try rg '\(<\$'

AndydeCleyre commented 10 months ago
$ zmodload zsh/mapfile

$ setopt extendedglob

$ non_empty_lines=(${(f)mapfile[lines.txt]%$'\n'})

$ without_comments=(${non_empty_lines:# #\###*})

$ man zshmodules