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

Re: VMS Style auto command-complition



On Thu, 25 Nov 2004, Peter Stephenson wrote:

> autoload autoexec
> zle -N autoexec
> alias -A autoexpand accept-line

Er, surely you mean either

zle -N accept-line autoexec

or

zle -N autoexec
zle -A autoexec accept-line

> and deactivate it with
> 
> alias -A .accept-line accept-line

zle -A .accept-line accept-line

> Instead of trying to execute a command and failing if it finds
> multiple possibilities, it outputs an error message underneath and
> allows you to edit the line again.

Which is also what my conditional-accept-line function does, BTW, though
it makes no effort to reposition the cursor for you.

> for hash in aliases reswords functions builtins commands; do

I like my "whence -w" a lot better here ... it's questionable in the next
loop whether forking "whence -m" is faster, but it's sure more obvious,
and doesn't require the parameter module.

>     (( curpos = CURSOR ))
>     BUFFER[1,$len]="$expn"
>     (( curpos <= len )) && (( CURSOR = ${#expn[1]} ))

Hmm.



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