Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Feature request (@M):# with context matches
- X-seq: zsh-users 21200
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Feature request (@M):# with context matches
- Date: Fri, 29 Jan 2016 11:15:37 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=3li9QVDArNhOfxy4/jt6Ao7hmXzbBVvmdaWoDJjrwIo=; b=utZLUX2gB25QeoBz8Oj1qszVQT9+LNYpSSCLbd/gKjHQ+bMQtf8MHuU15Gu7e23Y0I nsSR0HDPaMAqRcZ7AX2CUZC/iMS0W/QDcDoDCIeUlCAYjRF482Y8+zIu+ciwKY5+ZTVb sZ7cYjzr2Cfa7CR9nLvVRJH/nBMf/+l42Zx/m7ONPqAAnJhKM8sKeiVWUN/ZngqpGv80 9vpMY/fsugnQNUpfKuIWeX7Olkv0bA9BsI9Y9mQbxFbw69a9aVafiWDwa65uW9v2f++H 9Os6Sxgbg72nMc1T9fSBVVjSbeqEUm6srws6UHrHEyueOLN4izXDEN7WdLltVp3nyXd1 uY6w==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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