momo-lab / zsh-abbrev-alias

This zsh plugin provides functionality similar to Vim's abbreviation expansion.
MIT License
119 stars 14 forks source link

Define function with arguments #2

Open alem0lars opened 6 years ago

alem0lars commented 6 years ago

I'd like to expand aliases providing arguments, for example:

abbrev-alias -f hping-listen="hping -9 $1 -I $2 | /bin/sh"

Where $1 and $2 will be expanded to the first two arguments provided after the alias has been expanded.

Is that possible to do something similar to that?

I'd like something similar to vim's snippets expand functionality.

Thanks.

alem0lars commented 6 years ago

My idea is to do something like:

my-alias foo bar <C-x>

And it will expand my-alias replacing foo with in the first placeholder and bar in the second placeholder.