Skip to content

Instantly share code, notes, and snippets.

@jdan
Created November 14, 2017 04:41
Show Gist options
  • Select an option

  • Save jdan/a7a356b1953c1560d2ae94b8558bb953 to your computer and use it in GitHub Desktop.

Select an option

Save jdan/a7a356b1953c1560d2ae94b8558bb953 to your computer and use it in GitHub Desktop.
function shorthand() {
echo "${PWD/$HOME/~}" | tr "/" "\n" | cut -c 1 | tr "\n" "/" | rev | cut -c2- | rev
}
export PROMPT='%{$fg[cyan]%}$(shorthand)%{$reset_color%} $ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment