Last active
June 25, 2019 21:13
-
-
Save tanner0101/5b73eb2adda84545f27bfe8b5a091e11 to your computer and use it in GitHub Desktop.
zsh profile
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
# echo current git branch | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | |
} | |
# echo "*" if git status is unclean | |
parse_git_status() { | |
GIT_STATUS="$(git status 2>&1)" | |
if [[ $GIT_STATUS != *"clean"* ]] && | |
[[ $GIT_STATUS != *"not a git repository"* ]]; | |
then | |
echo "*" | |
else | |
echo "" | |
fi | |
} | |
# set custom zsh prompt, example: | |
# ~/dev/vapor/vapor master* $ | |
PS1='%F{magenta}%~%f%F{cyan}$(parse_git_branch)%f$(parse_git_status) $ ' | |
# enable prompt refreshing | |
setopt promptsubst | |
# set terminal title to current directory | |
precmd() { | |
echo -ne "\e]1;$(dirs)\a" | |
} | |
# Setting PATH for Python 3.7 | |
# The original version is saved in .bash_profile.pysave | |
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}" | |
export PATH | |
# Executes /bin/sh in a Swift docker container | |
_swift_linux() { | |
docker run -it -v $PWD:/root/code -w /root/code vapor/swift:5.0 /bin/sh | |
} | |
alias swift-linux='_swift_linux' |
Author
tanner0101
commented
Jun 25, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment