Created
March 26, 2014 14:09
-
-
Save wkf/9783999 to your computer and use it in GitHub Desktop.
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
function prompt_dir -d "Display the actual directory" | |
set -l root_path | |
set -l root_name | |
if command git rev-parse --is-inside-work-tree >/dev/null 2>&1 | |
set root_path (command git rev-parse --show-toplevel 2> /dev/null) | |
set root_name (basename $root_path) | |
set root_path (echo $root_path | sed -e 's/\//\\\\\//g') | |
prompt_segment normal "#404040" (echo $root_name(pwd | sed -e "s/$root_path//g")) | |
else | |
prompt_segment normal "#404040" (prompt_pwd) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment