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

Re: Enabling tab-completion for an alias



Mikael Magnusson skrev:
2008/6/13 David Sveningsson <ext@xxxxxxxxxxx>:
Mikael Magnusson skrev:
2008/6/13 David Sveningsson <ext@xxxxxxxxxxx>:
Hi, I'm having some trouble with tab-completion. I've created an alias
for
svn (subversion) which runs a pythonscript executing svn. One of the
reasons
for this is that I use the script to colorize the output.

However this caused zsh to stop tab-completing svn commands, eg. I used
to
be able to type "svn res[tab]" and it completes to "svn resolved". Is
there
a way to enable the same tab-completions for my alias?
Assuming your alias is
alias svn="myfoobarscript --blabla"
then you can put in
compdef _svn myfoobarscript=svn
and it should complete the same as svn

Almost, it looks like
alias svn="python ~/bin/svnc.py"

Is it possible anyway? Otherwise I guess I could always just wrap that in a
shellscript.

Easy solution is chmod +x ~/bin/svnc.py and change the alias to just the script.



You're right, anyway, I could not use "compdef _svn myfoobarscript=svn" but if I removed _svn it works. Thanks for your help!

--


//*David Sveningsson [eXt]*

Freelance coder | Game Development Student
http://sidvind.com

Thou shalt make thy program's purpose and structure clear to thy fellow man by using the One True Brace Style, even if thou likest it not, for thy creativity is better used in solving problems than in creating beautiful new impediments to understanding.



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