Skip to content

Instantly share code, notes, and snippets.

@iomarmochtar
Created September 26, 2021 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iomarmochtar/c3db8da3462f4cfd5f540d5bfc5b38a3 to your computer and use it in GitHub Desktop.
Save iomarmochtar/c3db8da3462f4cfd5f540d5bfc5b38a3 to your computer and use it in GitHub Desktop.
shell function to make viddy read an alias with it's arguments in zsh or bash
# modified version of https://github.com/sachaos/viddy/issues/2#issuecomment-907586514 for respecting passed arguments
# eg: vd kgp -n flux-system
function vd() {
args=$(echo $* | cut -d' ' -f 2-)
real_cmd=$(which $1 | cut -d' ' -f 4-)
viddy -d -n 1 --shell $SHELL "$real_cmd $args"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment