Reputation: 171
Here's a function that executes a selected alias using fzf:
fa() {
eval $(alias | fzf | cut -d'=' -f2 | sd -p "'" '')
}
The problem is that sometimes you want to add more arguments to an alias rather than immediately execute it. Is this possible?
Upvotes: 1
Views: 612
Reputation: 171
Solution using zsh:
fa() {
print -z $(alias | fzf | cut -d'=' -f2 | sd -p "'" '')
}
Upvotes: 2