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

Re: zsh completion with _files



Hi Bart, hi Oliver,

thanks a lot, that did the trick...

Kind regards
Cornelius

Am 07.10.2014 um 18:02 schrieb Oliver Kiddle:
> Cornelius Kölbel wrote:
>> I used tests for the previous and the pre-previous word like
>> $words[$#words-1 or 2] .
> That might not be want you want if the cursor is in the middle of the
> line rather than at the end. You might want $words[CURRENT] or
> $words[CURRENT-1], etc.
>
>> I realized that it might work this way:
>>
>>         local curr=$words[$#words]
>>
>>         case $curr in
>>         @*)
>>                 _files
>>         ;;
>>         esac
>> But then it is looking for files starting with @.
> You need to move the @ character from the PREFIX to the IPREFIX
> variable. There's a shortcut for this using the compset command:
>   if compset -P '@'; then
>     _files
>   else
>     ...
>
> Oliver


Attachment: signature.asc
Description: OpenPGP digital signature



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