Also it might have something to do with rclone having _rclone in the file instead of rclone. As you might see here.
You've reached max number of replies a new user can create. (not new user..?) Please wait 18 hours.
Yes I tried it and got errors.
So I removed oh-my-zsh and got started with the raw zsh installation wizard (understanding it is a huge headache!).
I got command completion with rclone working and I think I know why:
Wizard:
(2) Use the new completion system.
(now at compinstall menu)
2. Matching control: set behaviour for case-insensitive matching,
extended (partial-word) matching and substring matching.
3. Styles for changing the way completions are displayed and inserted.
4. Change whether old-style `compctl' completions will be used.
I set this to true.
and command completion works. Remote completion it just does nothing.
I'm not gonna use raw zsh (too large of a headache). I was on oh-my-zsh, but might move to prezto instead now.
I got command completion working with prezto (only need to add /usr/share/zsh/vendor-completions/ to fpath), but remote path gives me -- no matches found -- . It can't even autocomplete remotes listed in the local config ( something: ). Maybe encrypted config is causing it? Though I did rclone ls remote:, but still nothing.
Argm shell magic! $(type -t compopt) = "builtin" is checking whether compopt is a builtin or not. Presumably it either will be or won't be so we could replace that test with 0 = 0 (true) or 0 = 1 (false) if you want to see if you can get it going.
Is already done and that fixes command completion.
The additional question was related to bash completion which will autocomplete your paths and such on your remotes with tab. We were trying to get that to work on zsh as the bash completion bit does not seem to work for me (or OP)
So mine is it's current state is:
textere@seraphim ~ % cat .zshrc
alias home='ssh home'
alias router='ssh router'
PLEXAPI_CONFIG_PATH=/Users/textere/Documents/scripts/plexapi.ini
export PLEXAPI_CONFIG_PATH
fpath=(/Users/textere/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
# load bashcompinit for some old bash completions
autoload bashcompinit
bashcompinit
source ~/Downloads/rclone
The last 3 lines should make zsh bash completion compatible and allow it work but something isn't working properly with the bash compatibility.
I did read the whole thread but had thought that you may have missed that command in your latest trials.
I too faced the same errors regarding the -t flag & the missing _init_completion command while sourcing the autocomplete script for bash in zsh.
I worked-around the -t flag by replacing it with 0=0 or 0=1 as necessary, as suggested by ncw and solved the missing _init_completion by running the autoload & compinit command: autoload -U +X compinit && compinit
I also have the zsh-completion package installed via brew in case that makes a difference.