Re: Question. Autocomplete paths starting with %.

2011-02-24 Thread Clark J. Wang
On Thu, Feb 24, 2011 at 8:46 PM, d...@ucore.info wrote: > On Wed, Feb 23, 2011 at 5:06 AM, Clark J. Wang wrote: > > I can give you an example here: > > > > bash# vi compgen-example.sh > > _compgen_foo() > > { > > local cmd=$1 cur=$2 pre=$3 > > > > if [[ $cur = % ]]; then > > COMP

Re: Question. Autocomplete paths starting with %.

2011-02-24 Thread d...@ucore.info
On Wed, Feb 23, 2011 at 5:06 AM, Clark J. Wang wrote: > I can give you an example here: > > bash# vi compgen-example.sh > _compgen_foo() > { >     local cmd=$1 cur=$2 pre=$3 > >     if [[ $cur = % ]]; then >     COMPREPLY[0]='it-works' >     fi > } > > complete -F _compgen_foo foo > bash# sour

Re: Question. Autocomplete paths starting with %.

2011-02-22 Thread Clark J. Wang
On Sat, Feb 19, 2011 at 9:20 PM, d...@ucore.info wrote: > > I can script in Bash quite well, but I've never did anything that > fancy with completion and I don't know how to plug my function to > handle this. I understand that I should register something (function > named like _bookmarkcomp) to h