Skip to content

Instantly share code, notes, and snippets.

@ssbb
Created November 17, 2014 19:35
Show Gist options
  • Save ssbb/b0bae44912b83e87b104 to your computer and use it in GitHub Desktop.
Save ssbb/b0bae44912b83e87b104 to your computer and use it in GitHub Desktop.
function prompt_sorin_pwd {
local pwd="${PWD/#$HOME/~}"
if [[ "$pwd" == (#m)[/~] ]]; then
_prompt_sorin_pwd="$MATCH"
unset MATCH
else
_prompt_sorin_pwd="${${${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}%/}//\%/%%}/${${pwd:t}//\%/%%}"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment