aboutsummaryrefslogtreecommitdiff
path: root/my-zsh-completions.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'my-zsh-completions.plugin.zsh')
-rw-r--r--my-zsh-completions.plugin.zsh17
1 files changed, 17 insertions, 0 deletions
diff --git a/my-zsh-completions.plugin.zsh b/my-zsh-completions.plugin.zsh
new file mode 100644
index 0000000..458878a
--- /dev/null
+++ b/my-zsh-completions.plugin.zsh
@@ -0,0 +1,17 @@
+# -*- mode: sh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# Copyright (c) 2022 A Farzat
+# According to the Zsh Plugin Standard:
+# https://wiki.zshell.dev/community/zsh_plugin_standard
+0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
+0="${${(M)0:#/*}:-$PWD/$0}"
+# Then ${0:h} to get plugin's directory
+if [[ ${zsh_loaded_plugins[-1]} != */my-zsh-completions && -z ${fpath[(r)${0:h}]} ]] {
+ fpath+=( "${0:h}" )
+}
+# Standard hash for plugins, to not pollute the namespace
+typeset -gA Plugins
+Plugins[MY_ZSH_COMPLETIONS_DIR]="${0:h}"
+autoload -Uz example-script
+# Use alternate vim marks [[[ and ]]] as the original ones can
+# confuse nested substitutions, e.g.: ${${${VAR}}}
+# vim:ft=zsh:tw=120:sw=2:sts=2:et:foldmarker=[[[,]]]