Discover, install, and configure shell plugins with Fig Plugin Store →
🔥

Print Alias

A Zsh plugin for printing expanded aliases

brymck
|
15 stars
3 forks

print-alias

Test codecov

This prints commands with aliases expanded whenever you use an alias at the command line.

demo

Usage

With zplug, add the following to your ~/.zshrc:

zplug "brymck/print-alias"

You can also use Antigen:

antigen bundle brymck/print-alias

And lastly, if you want to source it manually, you can also clone this repo and use:

source path/to/print-alias.plugin.zsh

Configuration

You can change the line prefix as well as the format of expanded aliases and non-aliases. You can exclude some specific aliases to be displayed. You may as well prevent any command which has been redefined by an alias to be displayed (aliases such as alias grep='grep --colour' or alias ls='ls -aF')

export PRINT_ALIAS_PREFIX='  ╰─> '
export PRINT_ALIAS_FORMAT=$'\e[1m'
export PRINT_NON_ALIAS_FORMAT=$'\e[0m'

export PRINT_ALIAS_IGNORE_REDEFINED_COMMANDS=true
export PRINT_ALIAS_IGNORE_ALIASES=(my_alias my_other_alias)

zplug "brymck/print-alias"

The above will result in output such as the second line here:

configuration