Created
February 17, 2014 02:37
-
-
Save keith/9043754 to your computer and use it in GitHub Desktop.
Mimicking %2c from zsh
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
set __pwd (pwd) | |
set __parent (basename (dirname $__pwd)) | |
set __current (basename $__pwd) | |
set __full (printf "%s/%s" $__parent $__current) | |
set __home (echo $HOME | awk '{ print substr($1, 2, length($1) - 1); }') | |
set __prompt (echo "$__full" | sed -e "s|$__home|~|" -e "s|$USER|~|" -e "s|^///|/|" -e "s|^//|/|") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment