How to set auto-completion for AFNI programs in zsh?

Hi,

apsearch -update_all_afni_help
provides auto-completion for bash and tcsh, how to modify that for zsh?

Thanks,
2086

Hi 2086,

It looks like you can import the bash completion function into zsh, though the completion syntax for some of the AFNI programs does not work in zsh. We should try to clean that up (there might be 16 programs with issues : 1ddot 1deval 1dplot 3dAllineate 3dDeconvolve 3dmerge 3dTcat 3dTstat 3dttest++ afni afni_open apsearch meica.py plugout_drive to3d whereami).

But to get many programs, put a couple of autoload commands before sourcing the .help file, as in:

autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
source ~/.afni/help/all_progs.COMP.bash

I will make a note to look at this. Please let me know how it goes.

  • rick

Hi,
If you don’t like zsh you can change it with instructions here:
https://support.apple.com/en-us/HT208050

Thanks, Justin

Hi Rick,

Thanks for your help. Yes, it works now except the 16 programs you mentioned above.

Thanks,
2086

Hi Justin,

Thanks for your suggestion. I prefer the completion style in zsh more, actually.

Thanks,
2086

By the way, thanks for putting this on a new thread. I only just now noticed that the long 10.15 thread ended with you using autoload.

We’ve been a bit busy, and I am trying to catch up… :slight_smile:

  • rick

Hi Rick,

Thank you. I understand, you don’t have to explain it. I thought that post is too long, and the main problem has been solved, so I put it here.

Thanks,
2086