From 587b5545803a40bc5dcff81f7fa79d84879b27fd Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 16 May 2020 16:55:29 +0200 Subject: zsh-navigation-tools: update to 5937e57e Fixes #8476 --- .../zsh-navigation-tools.plugin.zsh | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh') diff --git a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh index 32b4ca064..f015620f5 100644 --- a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh +++ b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh @@ -1,9 +1,30 @@ #!/usr/bin/env zsh -0="${(%):-%N}" # this gives immunity to functionargzero being unset -export ZNT_REPO_DIR="${0%/*}" +# +# No plugin manager is needed to use this file. All that is needed is adding: +# source {where-znt-is}/zsh-navigation-tools.plugin.zsh +# +# to ~/.zshrc. +# + +# According to the standard: +# http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html +0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" +0="${${(M)0:#/*}:-$PWD/$0}" +export ZNT_REPO_DIR="${0:h}" export ZNT_CONFIG_DIR="$HOME/.config/znt" +# +# Update FPATH if: +# 1. Not loading with a plugin manager +# 2. Not having fpath already updated +# + +if [[ ${zsh_loaded_plugins[-1]} != */zsh-navigation-tools && -z ${fpath[(r)${0:h}]} ]] +then + fpath+=( "${0:h}" ) +fi + # # Copy configs # -- cgit v1.2.3-70-g09d2