Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Feature request (@M):# with context matches



Hello,
doing:

list=( "${(@M)list:#(#i)*$~search_pattern*}" )

can be used to replace call to grep. Array can be filtered with a
pattern, no fork is required. However, grep supports -A, -B, -C
options, that return also "A"-elements after or "B"-elements before,
or "C"-elements before and after a match. I thought that this is maybe
not difficult to add to Zsh? It's very useful thing. For example, when
using "less" to search for a keyword (like when reading zshall), user
finds surrounding text and it's basically actually what he searches
for.

Best regards,
Sebastian Gniazdowski



Messages sorted by: Reverse Date, Date, Thread, Author