Skip to content

Instantly share code, notes, and snippets.

@paulbellamy
Created September 14, 2018 13:18
Show Gist options
  • Save paulbellamy/274860335ba4c6661f859a118852b9be to your computer and use it in GitHub Desktop.
Save paulbellamy/274860335ba4c6661f859a118852b9be to your computer and use it in GitHub Desktop.
Nice little utility to use selecta with zsh z plugin.
# if selecta is present, set that as the default behaviour of z command
if which ${_Z_CMD:-z} 2>&1 1>/dev/null && which selecta 2>&1 1>/dev/null; then
z_selecta() {
if [ $# -gt 0 ]; then
_z "$@" 2>&1
else
_z "$(_z |& awk '{print $2}' | selecta)" 2>&1
fi
}
alias ${_Z_CMD:-z}='z_selecta'
fi
@Mayeu
Copy link

Mayeu commented May 15, 2019

Nice one 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment