Created
September 14, 2018 13:18
-
-
Save paulbellamy/274860335ba4c6661f859a118852b9be to your computer and use it in GitHub Desktop.
Nice little utility to use selecta with zsh z plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice one 👌