Skip to content

Instantly share code, notes, and snippets.

@zzamboni
Created March 2, 2018 13:14
Show Gist options
  • Save zzamboni/85366b60c79aaabf3b878716e7a116ff to your computer and use it in GitHub Desktop.
Save zzamboni/85366b60c79aaabf3b878716e7a116ff to your computer and use it in GitHub Desktop.
aliases = [&]
fn _load_alias [name file]{
alias = [&]
-source $file
aliases[$name] = $alias[$name]
}
fn def [&verbose=false name @cmd]{
file = $dir/$name.elv
echo "#alias:new" $name $@cmd > $file
echo 'alias['$name'] = [@_args]{' $@cmd '$@_args }' >> $file
if (not-eq $verbose false) {
echo (edit:styled "Defining alias "$name green)
}
_load_alias $name $file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment