From d0e2daac6b87e2977b3782170f138434b22b8a62 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Tue, 17 Jun 2025 07:23:30 +0000 Subject: Add z plugin --- fish/functions/__z_clean.fish | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 fish/functions/__z_clean.fish (limited to 'fish/functions/__z_clean.fish') diff --git a/fish/functions/__z_clean.fish b/fish/functions/__z_clean.fish new file mode 100644 index 0000000..ae1721a --- /dev/null +++ b/fish/functions/__z_clean.fish @@ -0,0 +1,11 @@ +function __z_clean -d "Clean up .z file to remove paths no longer valid" + set -l tmpfile (mktemp $Z_DATA.XXXXXX) + + if test -f $tmpfile + while read line + set -l path (string split '|' $line)[1] + test -d $path; and echo $line + end <$Z_DATA >$tmpfile + command mv -f $tmpfile $Z_DATA + end +end -- cgit v1.2.3