kloetzl / biozsh

the z in bioinformatics
MIT License
33 stars 5 forks source link

completions not working with antigen #2

Closed iimog closed 6 years ago

iimog commented 6 years ago

Hey @kloetzl thanks for this wonderful set of completions. Unfortunately they do not work out of the box with antigen. I'm using zsh 5.1.1 (x86_64-ubuntu-linux-gnu) with Antigen v2.2.2 (bd9d533).

The simple command

antigen bundle kloetzl/biozsh

installs the repo just fine (to ~/.antigen/bundles/kloetzl/biozsh) and sources the included biozsh.zsh. However the sourcing is done with the home folder as working directory so the $PWD inside biozsh.zsh does not work properly. Sourcing it manually from anywhere but the biozsh directory results in the same problem. A workaround is to determine the real location of the zsh file using this expression:

BIOZSH_DIR="${funcsourcetrace[1]%/*}"

This works according to this SO answer. This way the completions should work no matter from where the file is sourced. It also fixes the installation with antigen.