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

Re: globbing



Bart Schaefer wrote:
> You can, however, roll your own (but not in 3.0.x):
> 
>   bash-complete () {
>     emulate -L zsh
>     if [[ $RBUFFER = (|[[:space:]\;\&\|\>]*) ]]
>     then
>       zle complete-word         # Completing at end of word is not special
>     else
>       setopt noautomenu         # Cannot menu-complete the prefix, sorry
>       RBUFFER[1]=" $RBUFFER[1]" 
>       zle complete-word                  
>       RBUFFER[1,2]=$RBUFFER[2]           
>       if [[ $LBUFFER[-1] = $RBUFFER[1] ]]
>       then
> 	LBUFFER[-1]=''          # Suppress doubled slashes, for example
>       fi
>     fi
>   }
>   zle -N bash-complete
>   bindkey '\t' bash-complete
> 
> This could, I suppose, get added to the collection of bash-alike functions
> that PWS has created.  It does appear to work with `setopt bashautolist'.

That works _exactly_ how I wanted it to. Perhaps the normal way is better,
but old habits die hard.... thanks for going to the trouble of writing that
function too!

-- 
Sintax error in config file! (line 378)
aborted!



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