Last active
December 12, 2021 15:57
-
-
Save ty-porter/92d36a4f758a990dd65f40dae73895fe to your computer and use it in GitHub Desktop.
zsh Prompt Configuration
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
# Rails | |
alias be="bundle exec" | |
alias ber="bundle exec rails" | |
# git | |
alias gcm="git commit -m" | |
alias gp="git push" | |
alias gst="git status" | |
alias gco="git checkout" | |
# Rubocop | |
alias cop="git ls-files -m | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop" |
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
# Find and set branch name var if in git repository. | |
function git_branch_name() | |
{ | |
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}') | |
if [[ $branch == "" ]]; | |
then | |
: | |
else | |
echo '- (%B%F{009}'$branch'%f%b) ' | |
fi | |
} | |
# Enable substitution in the prompt. | |
setopt prompt_subst | |
# Config for prompt. PS1 synonym. | |
prompt='%B%F{078}%2/%f%b $(git_branch_name)/> ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This adds the
git
branch (if applicable) as well as changes the colors of the prompt