Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Tip of the day: previous command output

On 2004-08-20 21:25:47 -0700, Bart Schaefer wrote:
> On Fri, 20 Aug 2004, Vincent Lefevre wrote:
> > And would it be possible to get a menu, in order to select one or
> > several filenames manually?
> For that we get a little more intense:
>   _insert_kept() {
>     (( $#kept )) || return 1
>     local action
>     zstyle -s :completion:$curcontext insert-kept action
>     if [[ -n $action ]]
>     then compstate[insert]=$action
>     fi
>     compadd -a kept
>   }
>   zle -C insert-kept-result complete-word _generic
>   zstyle ':completion:insert-kept-result:*' completer _insert_kept
> Now you get Andy's thing with
>   zstyle ':completion:*' insert-kept all
> Or you can get menu completion with
>   zstyle ':completion:*' insert-kept menu
> and it does menu completion according to whatever your other usual
> styles are (or you can add other specific styles for this context).

I was talking about another kind of menu (which could be useful for
standard completion too). For instance, there could be a cursor for
the (standard zsh) menu, or perhaps a number, to be able to choose
one or several word candidates.

$ echo [TAB]
[ab] ef  ij
 cd  gh  kl

[...] represents the cursor around "ab".


$ echo [TAB]
1 ab  3 ef  5 ij
2 cd  4 gh  6 kl

then typing some key followed by the number would insert the word.
This may be useful when there are many common prefixes (this often
occurs in practice).

Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% validated (X)HTML - Acorn / RISC OS / ARM, free software, YP17,
Championnat International des Jeux Mathématiques et Logiques, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

Messages sorted by: Reverse Date, Date, Thread, Author