Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion of CLI parameters
- X-seq: zsh-users 7422
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Completion of CLI parameters
- Date: Sat, 01 May 2004 15:14:57 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <15385.1083243379@xxxxxxx> <1040429145959.ZM31110@xxxxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author