From d79531331f979a31b605eb0213e1c35d525e4cef Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Fri, 25 May 2018 17:18:31 +0200 Subject: [PATCH] *-highlight: FAST_BLIST_PATTERNS --- README.md | 8 ++++++++ hsmw-highlight | 1 + 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 2624035..b6d573f 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,14 @@ with surrounding commands: [![asciicast](https://asciinema.org/a/155704.png)](https://asciinema.org/a/155704) # News +* 25-05-2018 + - Hash holding paths that shouldn't be grepped (globbed) – blacklist for slow disks, mounts, etc.: + + ```zsh + typeset -gA FAST_BLIST_PATTERNS + FAST_BLIST_PATTERNS[/mount/nfs1/*]=1 + FAST_BLIST_PATTERNS[/mount/disk2/*]=1 + ``` * 13-06-2017 - Canceling search doesn't clear entered query. Change to previous behavior via: diff --git a/hsmw-highlight b/hsmw-highlight index de56139..e3b427f 100644 --- a/hsmw-highlight +++ b/hsmw-highlight @@ -635,6 +635,7 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=( -hsmw-highlight-check-path() { : ${expanded_path:=${(Q)~arg}} + [[ -n "${FAST_BLIST_PATTERNS[(K)$expanded_path]}" ]] && return 1 [[ -z $expanded_path ]] && return 1 [[ -e $expanded_path ]] && return 0