zsh-users
 help / color / mirror / code / Atom feed
From: zzapper <david@tvis.co.uk>
To: zsh-users@sunsite.dk
Subject: Re: Completion of CLI parameters
Date: Sat, 01 May 2004 15:14:57 +0100	[thread overview]
Message-ID: <65c790119uqg8063k7r9eoft9vp1n2vvd2@4ax.com> (raw)
In-Reply-To: <1040429145959.ZM31110@candle.brasslantern.com>

On Thu, 29 Apr 2004 14:59:58 +0000,  wrote:

>On Apr 29,  1:56pm, Peter Stephenson wrote:
>}
>} autoload -U insert-args-of
>} zle -N insert-args-of
>} bindkey '^x^a' insert-args-of
>
>Oliver would say this was crying out to be a _generic completer; here's
>a trivial stab at one.  However, the right thing would be for _expand to
>recognize a zstyle -- perhaps named "expander" -- that would supply a
>function to produce expansions, and to try calling that before falling
>back on the usual shell expansions.  That way we'd get the full power of
>all the other styles recognized by _expand.
>
>The following suffers from the usual problems of menus that may contain
>multi-line structures, I haven't done anything to address that.
>
>#autoload
># Name this file expand-args-of and place it in a $fpath directory, and
># then add these commands to .zshrc:
>#  zle -C expand-args-of complete-word _generic
>#  zstyle ':completion:expand-args-of::::' completer expand-args-of
>#  bindkey '^x^a' expand-args-of
>
>local pat=$words[CURRENT]
>local -a exp
>
>if ((CURRENT > 1))
>then
>  # Remove the first * here to match on command name only
>  exp=( $history[(R)*${(q)pat}*] )
>  exp=( ${exp#*[[:space:]]} )
>else
>  exp=( $history[(R)${(q)pat}*] )
>fi
>compadd -UQ -a exp
>compstate[insert]=menu
>
>#end of expand-args-of

This one just beeps at me?!?

zzapper (vim, cygwin, wiki & zsh)
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips


  reply	other threads:[~2004-05-01 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a5u190lnjueh9jiu4ci6bq5uimo4d5tu37@4ax.com>
2004-04-29 12:56 ` Peter Stephenson
2004-04-29 14:59   ` Bart Schaefer
2004-05-01 14:14     ` zzapper [this message]
2004-05-01 17:50       ` Bart Schaefer
2004-05-02 15:35         ` zzapper
     [not found] <4me190pohevfcnoecm43f7ab9cclh3233g@4ax.com>
2004-04-29 11:40 ` Peter Stephenson
2004-04-28 15:56 zzapper
2004-04-28 17:39 ` Peter Stephenson

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=65c790119uqg8063k7r9eoft9vp1n2vvd2@4ax.com \
    --to=david@tvis.co.uk \
    --cc=zsh-users@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).