zsh-workers
 help / color / mirror / code / Atom feed
From: Ulf Magnusson <ulfalizer@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Auto-insertion of quotes when completing
Date: Wed, 15 Jun 2005 11:44:28 +0200	[thread overview]
Message-ID: <cf7bbda90506150244405e0ec0@mail.gmail.com> (raw)

I'm writing a completion for xmms that allows me to complete among all
my music files from the command line. The script that invokes xmms is
called mu, and is used like this:

mu Foo<TAB>  ->  mu Fooband\ -\ B<TAB>  ->  mu Fooband\ -\ Barsong

I often prefer to quote the argument to mu, because it looks better
and makes it easier to chose among files whose names contain funny
characters. That is:

mu "Foo<TAB>  ->  mu "Fooband - B<TAB>  ->  mu "Fooband - Barsong"
(I chose " instead of ' since ' is a more common character in my
files' names, and \" looks better than '\'' anyway)

I was wondering if there is some way to have the completion
automatically quoted when I first press tab, so that the following
would work:

mu Foo<TAB>  ->  mu "Fooband - B<TAB>  ->  etc.

The normal auto-quoting of " when pressing tab should of course still
apply, so the following should be handled correctly:

mu Thi<TAB>  ->  mu "This song's name has a \" in it"

Is there some (easy) way to do this?

Ulf


                 reply	other threads:[~2005-06-15  9:44 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=cf7bbda90506150244405e0ec0@mail.gmail.com \
    --to=ulfalizer@gmail.com \
    --cc=zsh-workers@sunsite.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).