mattmc3/antidote

no such file or directory

AurevoirXavier opened this issue · 15 comments

ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/brew
ohmyzsh/ohmyzsh path:plugins/command-not-found
ohmyzsh/ohmyzsh path:plugins/gh
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/sudo
ohmyzsh/ohmyzsh path:plugins/npm
ohmyzsh/ohmyzsh path:plugins/nvm
ohmyzsh/ohmyzsh path:plugins/rust
ohmyzsh/ohmyzsh path:plugins/yarn
/Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gh/gh.plugin.zsh:14: no such file or directory: /completions/_gh
/Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/rust/rust.plugin.zsh:22: no such file or directory: /completions/_rustup
/Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/rust/rust.plugin.zsh:23: no such file or directory: /completions/_cargo

It looks like #73 (comment) doesn't work for me.

After set the cache dir follow #70.

I got:

/Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gh/gh.plugin.zsh:14: no such file or directory: /Users/xavier/.cache/oh-my-zsh/completions/_gh
/Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/rust/rust.plugin.zsh:22: no such file or directory: /Users/xavier/.cache/oh-my-zsh/completions/_rustup
/Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/rust/rust.plugin.zsh:23: no such file or directory: /Users/xavier/.cache/oh-my-zsh/completions/_cargo

Solved. I have to create the completions folder manually. But this looks like an issue. Why do I have to do this manually?

After I get rid of all the errors, the completions still didn't work.

When I press the tab, it only shows the folder.

gh <TAB>
rustup <TAB>
cargo <TAB>

Finally, it works.

I have to write fpath+=~/.cache/oh-my-zsh/completions myself.

Glad you got it working. Antidote does't do anything special with Oh-My-Zsh - it treats it like any other set of plugins, the same as antibody did. OMZ isn't really a set of independent plugins. It's a framework that's a rats nest of interdependencies. If OMZ needed you to add that to your fpath, you could also have added it to your .zsh_plugins.txt file like so:

$HOME/.cache/oh-my-zsh/completions kind:fpath
$HOME/.cache/oh-my-zsh/completions kind:fpath

This doesn't work.

# antidote cloning $HOME/.cache/oh-my-zsh/completions...
remote: Not Found
fatal: repository 'https://github.com/$HOME/.cache/oh-my-zsh/completions/' not found
remote: Not Found
fatal: repository 'https://github.com/$HOME/.cache/oh-my-zsh/completions/' not found
antidote: error: bundle path not found '/Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-$HOME-SLASH-.cache-SLASH-oh-my-zsh-SLASH-completions'.

See How do I use $VARIABLES in my .zsh_plugins.txt file?. Or just replace $HOME with your actual home.

See How do I use $VARIABLES in my .zsh_plugins.txt file?. Or just replace $HOME with your actual home.

Change to full path works(no any error). But with this, I got this problem again.

After I get rid of all the errors, the completions still didn't work.

When I press the tab, it only shows the folder.

gh <TAB>
rustup <TAB>
cargo <TAB>

It looks like I have to add this to my zshrc.

fpath+=~/.cache/oh-my-zsh/completions

Zsh requires your fpath to be fully populated before you run compinit. You likely have things out of order.

See #74

Zsh requires your fpath to be fully populated before you run compinit. You likely have things out of order.

See #74

Thanks for your quick response.

Here is my zshrc. I think the order is correct.

fpath+=~/.cache/oh-my-zsh/completions

antidote_dir=${ZDOTDIR:-~}/.antidote
plugins_txt=${ZDOTDIR:-~}/.zsh_plugins.txt
static_file=${ZDOTDIR:-~}/.zsh_plugins.zsh

source $antidote_dir/antidote.zsh

ZSH=$(antidote path ohmyzsh/ohmyzsh)
ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh"
[[ -d $ZSH_CACHE_DIR ]] || (mkdir -p $ZSH_CACHE_DIR && mkdir -p $ZSH_CACHE_DIR/completions)

if [[ ! $static_file -nt $plugins_txt ]]; then
  [[ -e $antidote_dir ]] ||
    git clone --depth=1 https://github.com/mattmc3/antidote $antidote_dir
  (
    source $antidote_dir/antidote.zsh
    [[ -e $plugins_txt ]] || touch $plugins_txt
    antidote bundle <$plugins_txt >$static_file
  )
fi

autoload -Uz compinit && compinit

source $static_file

Can you show me the contents of your static file too (${ZDOTDIR:-~}/.zsh_plugins.zsh)?

Can you show me the contents of your static file too (${ZDOTDIR:-~}/.zsh_plugins.zsh)?

fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/bzr.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/cli.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/clipboard.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/compfix.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/completion.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/correction.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/diagnostics.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/directories.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/functions.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/git.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/grep.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/history.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/key-bindings.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/misc.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/nvm.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/prompt_info_functions.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/spectrum.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/termsupport.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/theme-and-appearance.zsh
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/vcs_info.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/command-not-found )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/command-not-found/command-not-found.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gh )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gh/gh.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/git )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/git/git.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/sudo )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/sudo/sudo.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/npm )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/npm/npm.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/nvm )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/nvm/nvm.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/rust )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/rust/rust.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/yarn )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/yarn/yarn.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zaw )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zaw/zaw.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions/zsh-completions.plugin.zsh
fpath+=( /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting )
source /Users/xavier/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh

BTW, the txt:

ohmyzsh/ohmyzsh path:lib

ohmyzsh/ohmyzsh path:plugins/command-not-found
ohmyzsh/ohmyzsh path:plugins/gh
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/sudo
ohmyzsh/ohmyzsh path:plugins/npm
ohmyzsh/ohmyzsh path:plugins/nvm
ohmyzsh/ohmyzsh path:plugins/rust
ohmyzsh/ohmyzsh path:plugins/yarn

zsh-users/zaw
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
zsh-users/zsh-syntax-highlighting

After I get rid of all the errors, the completions still didn't work.

When I press the tab, it only shows the folder.

gh <TAB>
rustup <TAB>
cargo <TAB>

I solved this problem of rustup completions not picking up by using mattmc3/zephyr path:plugins/completion at the end of the txt and specifying $MYHOMEDIR/.cache/oh-my-zsh/completions kind:fpath in the beginning. After antidote load everything started working.

However, I'm having trouble picking up volta completions, and I do not understand why. rust completions exist in the completions folder and work correctly, meaning zephyr looks in that dir and picks up the completions. _volta also exists there, and looks like a valid completions file, but

volta <Tab>

does nothing. What could be the cause? I've ran antidote load, deleted .zsh_plugins.zsh, ~/.cache/oh-my-zsh/completions, and ~/Library/Caches/antidote, but it didn't fix the problem. No errors thrown either

.zshrc

...
# Volta Setup
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"

# Prep antidote
source /usr/local/opt/antidote/share/antidote/antidote.zsh

# set omz variables
ZSH=$(antidote path ohmyzsh/ohmyzsh)
ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh"
[[ -d $ZSH_CACHE_DIR ]] || mkdir -p $ZSH_CACHE_DIR

# Load antidote
antidote load
...

.zsh_plugins.txt

$MYHOMEDIR/.cache/oh-my-zsh/completions kind:fpath

romkatv/powerlevel10k

# zsh plugins
ohmyzsh/ohmyzsh path:plugins/brew
ohmyzsh/ohmyzsh path:plugins/fzf
ohmyzsh/ohmyzsh path:plugins/gcloud
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/pyenv kind:defer
ohmyzsh/ohmyzsh path:plugins/rust
ohmyzsh/ohmyzsh path:plugins/thefuck
ohmyzsh/ohmyzsh path:plugins/volta
ohmyzsh/ohmyzsh path:plugins/vscode
ohmyzsh/ohmyzsh path:plugins/yarn

zsh-users/zsh-completions
zsh-users/zsh-autosuggestions
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search

mattmc3/zephyr path:plugins/completion

What could be the cause? I've ran antidote load, deleted .zsh_plugins.zsh, ~/.cache/oh-my-zsh/completions, and ~/Library/Caches/antidote, but it didn't fix the problem. No errors thrown either

@mikemykhaylov - mattmc3/zephyr path:plugins/completion also uses a 20 hour cache for completions. If you are having trouble with your completions, you'll also want to add rm -i ~/.cache/zsh/*compdump* to your cleanup.

I've decided to relent and add a proper (optional) compinit call to an upcoming release of antidote (1.7.5?). Completions are tough, and there are enough users of OMZ that I'm now convinced. I need to wrap up the use ohmyzsh feature first.