We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43fd7cc commit 02b8f7fCopy full SHA for 02b8f7f
README.md
@@ -0,0 +1,4 @@
1
+print-alias
2
+===========
3
+
4
+This prints aliases.
print-alias.plugin.zsh
@@ -0,0 +1,20 @@
+local -r ALIAS_FORMAT=$'\e[36m'
+local -r NON_ALIAS_FORMAT=$'\e[2m'
+local -r RESET_COLORS=$'\e[0m'
5
+_print-alias-accept-line () {
6
+ emulate -L zsh
7
+ local -a words
8
+ words=( ${(z)BUFFER} )
9
+ local -r first_word=${words[1]}
10
+ if [[ "$(whence -w $first_word 2>/dev/null)" == "${first_word}: alias" ]]; then
11
+ shift words
12
+ echo -nE $'\n'"${ALIAS_FORMAT}$(whence $first_word)${RESET_COLORS}"
13
+ for word in $words; do
14
+ echo -nE " ${NON_ALIAS_FORMAT}${word}${RESET_COLORS}"
15
+ done
16
+ fi
17
+ zle .accept-line
18
+}
19
20
+zle -N accept-line _print-alias-accept-line
0 commit comments