2025-02-28
Tracking Down zsh Alias Plugin Sources
When hunting for the origin of mysteriously defined by unknown plugin zsh aliases:
zsh -xv 2>&1 | grep "alias_name"
This works by:
- Starting zsh with
-x
(trace) and-v
(verbose) flags - Redirecting both stdout and stderr (
2>&1
) to capture all output - Filtering with
grep
to find when your alias is defined
For a more targeted approach with less output:
zsh -xv 2>&1 | grep -A 3 "source.*plugin" | grep "alias_name"
This helps identify which plugin file is sourcing your alias.