From 2f345a3d0c9a94891c909a9ae6f6e2e2dc6df5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 5 Mar 2020 13:08:05 +0100 Subject: [PATCH] shrink-path: added glob and quote options (#7694) * Added -g option to shrink-path plugin. The new optins adds an asterix to the uniquely shortened name, such that, if copy'n'pasted, zsh globbing will expand to the full path name of the shortened path: shrink-path -g: "/net/software/modules/modulefiles" -> "/n*/s*/modules/m*" shrink-path -l -g: "/net/software/modules/modulefiles" -> "/n*/s*/modules/modulefiles" * Updated also the README file with the new -g option. * shrink-path: improved handling of special cases This commits improves the handling of special cases in path strings: - handling of white space in path names - handling of single-letter path names * Update plugins/shrink-path/README.md Co-Authored-By: Jacob Tomaw * Fix typo "Asterix" and replace with "asterisk" * Add optional quoting support to shrink_path Co-authored-by: Jacob Tomaw --- plugins/shrink-path/README.md | 19 +++++++++++++------ plugins/shrink-path/shrink-path.plugin.zsh | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/plugins/shrink-path/README.md b/plugins/shrink-path/README.md index 54bc351d3..33dc3f8ae 100644 --- a/plugins/shrink-path/README.md +++ b/plugins/shrink-path/README.md @@ -7,21 +7,26 @@ For this directory tree: ``` /home/ me/ - foo/ + f o o/ # The prefix f is ambiguous between "f o o" and "f i g". bar/ quux/ biz/ # The prefix b is ambiguous between bar and biz. + f i g/ + baz/ ``` here are the results of calling `shrink_path