From c53519512702537bfb2a85e426a03643aac1100e Mon Sep 17 00:00:00 2001 From: Grigorii Horos Date: Thu, 16 Apr 2020 20:27:23 +0300 Subject: [PATCH] Make plugin compatible with zsh plugin standard --- functions | 1 + zsh-completions.plugin.zsh | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 120000 functions diff --git a/functions b/functions new file mode 120000 index 0000000..e831038 --- /dev/null +++ b/functions @@ -0,0 +1 @@ +src \ No newline at end of file diff --git a/zsh-completions.plugin.zsh b/zsh-completions.plugin.zsh index b56f55d..c15dd37 100644 --- a/zsh-completions.plugin.zsh +++ b/zsh-completions.plugin.zsh @@ -1 +1,9 @@ -fpath+="${0:h}/src" +# Standarized $0 handling, following: +# https://github.com/zdharma/Zsh-100-Commits-Club/blob/master/Zsh-Plugin-Standard.adoc +0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" +0="${${(M)0:#/*}:-$PWD/$0}" + +if [[ $PMSPEC != *f* ]] { + fpath+=( "${0:h}/functions" ) +} +