From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _tilde
Date: 16 Jun 1999 00:34:22 +0900 [thread overview]
Message-ID: <rsqso7tpjep.fsf@crane.jaist.ac.jp> (raw)
I modified _tilde to complete numbers after ~+ and ~-.
How about this?
--- Completion/Base/_tilde- Wed Jun 16 00:24:35 1999
+++ Completion/Base/_tilde Wed Jun 16 00:32:40 1999
@@ -7,10 +7,32 @@
# `(( compstate[nmatches] )) || compgen -nu -qS/'
# below that.
+local c s dirs list
+
if [[ "$SUFFIX" = */* ]]; then
ISUFFIX="/${SUFFIX#*/}$ISUFFIX"
SUFFIX="${SUFFIX%%/*}"
- compgen -nu -S ''
+ s=(-S '')
else
- compgen -nu -qS/
+ s=(-qS/)
fi
+
+if compset -P +; then
+ dirs="$(dirs -v)"
+ list=("${(f)dirs}")
+ [[ -o pushdminus ]] && dirs="$(awk '{ $1 = '$#list' - $1 - 1;
+ printf("%s\t%s\n", $1, $2); }' <<<$dirs)"
+ list=("${(@)list% *}")
+ c=(-y '$dirs' -k "($list)")
+elif compset -P -; then
+ dirs="$(dirs -v)"
+ list=("${(f)dirs}")
+ [[ ! -o pushdminus ]] && dirs="$(awk '{ $1 = '$#list' - $1 - 1;
+ printf("%s\t%s\n", $1, $2); }' <<<$dirs)"
+ list=("${(@)list% *}")
+ c=(-y '$dirs' -k "($list)")
+else
+ c=(-nu)
+fi
+
+compgen "$c[@]" "$s[@]"
--
Tanaka Akira
reply other threads:[~1999-06-15 15:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=rsqso7tpjep.fsf@crane.jaist.ac.jp \
--to=akr@jaist.ac.jp \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).