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

java class names completion widget


I'd like to mimic IDEA's (one of Java IDEs) classes searching in zsh. It 
allows to find classes specifying only their names with some lower case 
letters ommitted. For instance, "MDCl" will match "org.bar.MyDumbClass".
More strictly, each capital letter means "this letter followed by any number 
of lower-case letters".

I've made a simple function which generates a regexp by such abbreviations:

function makeClassRegexp {
    for (( i=1; $i<=${#word}; i++ )) {
        if [[ $char == *[[:upper:]]* ]] {
    echo $res"(.*)\.java$"

Now I can easily find classes under the current dir:

fcl() {
    regexp=`makeClassRegexp $1`
    find . -type f | GREPP $regexp

(where GREPP is aliased to 'grep -P' or pcregrep on different distros).

kos@kos ~/work/jrs/src $ fcl SHMa

Now I want to convert it into a completion widget. What is the easiest way to 
do it?


* Walk softly and carry a fully charged PHASER!			      

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