Skip to content

Instantly share code, notes, and snippets.

@elklein96
Last active October 25, 2017 16:13
Show Gist options
  • Save elklein96/927890a9c0218590cd69b93674c05c71 to your computer and use it in GitHub Desktop.
Save elklein96/927890a9c0218590cd69b93674c05c71 to your computer and use it in GitHub Desktop.
Zsh Config
# Path to Oh-My-Zsh installation
export ZSH=/Users/evanklein/.oh-my-zsh
# Plugins
plugins=(git)
source $ZSH/oh-my-zsh.sh
# Configure prompt
export ZSH_THEME_GIT_PROMPT_PREFIX="[git:"
export ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color"
export ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]+"
export ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]"
PROMPT='$fg[cyan]$(whoami): $fg[yellow]$(get_pwd) $(git_prompt_info) $fg[magenta]$(node_version)
$reset_color$ '
function get_pwd() {
echo "${PWD/$HOME/~}"
}
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function node_version() {
echo "(Node.js $(node -v))"
}
alias mkcd="mkdir $1 && cd &1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment