Created
July 28, 2015 10:40
-
-
Save olvlvl/0a9770ba65854a08ce7c to your computer and use it in GitHub Desktop.
Shell prompt
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
_short_pwd () | |
{ | |
local PRE= NAME="$1" LENGTH="$2"; | |
[[ "$NAME" != "${NAME#$HOME/}" || -z "${NAME#$HOME}" ]] && | |
PRE+='~' NAME="${NAME#$HOME}" LENGTH=$[LENGTH-1]; | |
((${#NAME}>$LENGTH)) && NAME="/...${NAME:$[${#NAME}-LENGTH+4]}"; | |
echo "$PRE$NAME" | |
} | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
PS1='\[\e[36m\]$(_short_pwd "$PWD" 32):\[\e[96m\]\$\[\e[0m\] ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment