Skip to content

Instantly share code, notes, and snippets.

@flyptkarsh
Created February 16, 2024 21:03
Show Gist options
  • Select an option

  • Save flyptkarsh/0e845c821604a7b1ba9ce174e4aa7d81 to your computer and use it in GitHub Desktop.

Select an option

Save flyptkarsh/0e845c821604a7b1ba9ce174e4aa7d81 to your computer and use it in GitHub Desktop.
zshrc Settings
# Function to parse the current Git branch
parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
# Color definitions
COLOR_DEF=$'%f'
COLOR_USR=$'%F{243}'
COLOR_DIR=$'%F{197}'
COLOR_GIT=$'%F{39}'
# Enable prompt substitution
setopt PROMPT_SUBST
# Set the prompt format
export PROMPT='${COLOR_USR}%n ${COLOR_DIR}%~ ${COLOR_GIT}$(parse_git_branch)${COLOR_DEF} $ '
# Aliases
alias chrome='open -a "Google Chrome.app"'
alias code='code-insiders'
alias gplm='git pull origin main --ff'
alias gplom='git pull origin main --ff'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment