summaryrefslogtreecommitdiff
path: root/plugins/aliases/aliases.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/aliases/aliases.plugin.zsh')
-rw-r--r--plugins/aliases/aliases.plugin.zsh23
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/aliases/aliases.plugin.zsh b/plugins/aliases/aliases.plugin.zsh
index 4e1e0558e..9864de957 100644
--- a/plugins/aliases/aliases.plugin.zsh
+++ b/plugins/aliases/aliases.plugin.zsh
@@ -1,11 +1,14 @@
-# with lots of 3rd-party amazing aliases installed, just need something to explore it quickly.
-#
-# - acs: alias cheatsheet
-# group alias by command, pass addition argv to grep.
-function acs(){
- (( $+commands[python3] )) || {
- echo "[error] No python executable detected"
- return
+# Handle $0 according to the standard:
+# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
+0="${${(M)0:#/*}:-$PWD/$0}"
+
+eval '
+ function acs(){
+ (( $+commands[python3] )) || {
+ echo "[error] No python executable detected"
+ return
+ }
+ alias | python3 "'"${0:h}"'/cheatsheet.py" "$@"
}
- alias | python3 ${functions_source[$0]:h}/cheatsheet.py $@
-}
+'