Skip to content

Instantly share code, notes, and snippets.

@pstaender
Last active December 25, 2015 10:29
Show Gist options
  • Save pstaender/6961661 to your computer and use it in GitHub Desktop.
Save pstaender/6961661 to your computer and use it in GitHub Desktop.
~/.oh-my-zsh/themes/pstaender.zsh-theme
#!/usr/bin/env zsh
setopt promptsubst
autoload -U add-zsh-hook
PROMPT_SUCCESS_COLOR=$FG[117]
PROMPT_FAILURE_COLOR=$FG[124]
PROMPT_VCS_INFO_COLOR=$FG[242]
PROMPT_PROMPT=$FG[077]
GIT_DIRTY_COLOR=$FG[133]
GIT_CLEAN_COLOR=$FG[118]
GIT_PROMPT_INFO=$FG[011] #012
PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$PROMPT_PROMPT%}$(hostname) %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status)%{$fg_bold[red]%}★%{$reset_color%} '
export PATH=~/bin:$PATH
# git
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔"
ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}"
# aliases
alias gitbranch="git branch --color=always --column"
alias gitlog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
alias gitmod='git status | grep modified | sed "s/^.*modified\: *//g"'
alias gitundo='git reset --soft HEAD^'
alias gitundohard='git reset --hard HEAD~1'
alias gitwhich='git log --oneline --decorate --color=always --branches --no-walk'
alias gitwho='git log --decorate --color=always --branches --no-walk'
alias gitoverview="git log --oneline --branches --no-walk --pretty=format:'%Cred%h%Creset -%C(bold yellow)%d%Creset %s %Cgreen(%cr) %C(red)<%an>%Creset' --abbrev-commit"
#alias gitignore="git update-index --assume-unchanged "
alias gitunignore="git update-index --no-assume-unchanged "
alias gitmergeconflict='git mergetool -t opendiff'
alias gitconflictfiles='git diff --name-only --diff-filter=U'
alias gitdiffjson=git log --pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "verification_flag": "%G?",%n "signer": "%GS",%n "signer_key": "%GK",%n "author": {%n "name": "%aN",%n "email": "%aE",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "email": "%cE",%n "date": "%cD"%n }%n},'
alias __='cd ..'
alias allprocesses='ps aux'
alias catch='watch -n 1 cat'
alias netstattulpen='lsof -i -P'
alias listenports='sudo lsof -nP | grep LISTEN'
alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
alias l='ls -al'
alias ll='ls -l'
# MAC manipulators
# https://gist.github.com/jashkenas/5113149
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
afpStop() {
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
}
afpStart() {
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment