Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with fake-files style and cd
- X-seq: zsh-users 13857
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: Problem with fake-files style and cd
- Date: Sat, 14 Feb 2009 15:26:20 -0800
- In-reply-to: <237967ef0902141409o3a0c30a1mfbae985453403342@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <mikachu@xxxxxxxxx> <237967ef0902140622s7389d2c8h5a0c786dcf207422@xxxxxxxxxxxxxx> <200902141801.n1EI1E2l003603@xxxxxxxxxxxxxxxxxxx> <237967ef0902141019t30118690m30116c9413015d96@xxxxxxxxxxxxxx> <090214111316.ZM15188@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0902141141y609b61d3i154546f6f6886c65@xxxxxxxxxxxxxx> <090214133904.ZM15383@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0902141409o3a0c30a1mfbae985453403342@xxxxxxxxxxxxxx>
On Feb 14, 11:09pm, Mikael Magnusson wrote:
}
} > zstyle -e :completion::complete:cd::path-directories ignored-patterns \
} > 'reply=( *(/) )'
} >
} > This says that when completing in the cdpath, ignore any name that matches
} > the name of a directory in the current directory.
}
} while the above appears to work, it really doesn't:
} % mkdir path/code/foo
} % cd code/<tab>
} ---- local directory
} foo/
} ---- directory in cdpath
} bar/ foo/
}
} Presumably this is because *(/) (which I changed to *(-/) (not in the
} above testcase though)) only matches one segment and that *(/) is run
} in $PWD, not $PWD/$PREFIX?
Yep, true. Try it this way:
zstyle -e :completion::complete:cd::path-directories ignored-patterns \
'reply=( ${PREFIX}*(-/) )'
You might need to fool around with that a bit; for example, if you don't
use the _expand completer you may want ${~PREFIX}*(-/) instead. There
may also be tricky bits with IPREFIX, QIPREFIX, and special cases for
completing in the middle of a word instead of at the end.
--
Messages sorted by:
Reverse Date,
Date,
Thread,
Author