Created
May 7, 2015 12:52
-
-
Save wrick17/d7e7b0d15ffb40537a4e to your computer and use it in GitHub Desktop.
Dark Vegas Zsh Theme
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
function get_pwd() { | |
echo "${PWD/$HOME/~}" | |
} | |
function git_prompt_info() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
} | |
function put_spacing() { | |
local git=$(git_prompt_info) | |
if [ ${#git} != 0 ]; then | |
((git=${#git} - 10)) | |
else | |
git=10 | |
fi | |
local termwidth | |
(( termwidth = ${COLUMNS} - ${#HOST} - ${#USER} - ${#$(get_pwd)} - ${git} - 5 )) | |
local spacing="" | |
for i in {1..$termwidth}; do | |
spacing="${spacing} " | |
done | |
echo $spacing | |
} | |
PROMPT='$fg[cyan]%n $fg[blue]:: $fg[yellow]%m $fg[magenta]➜ $fg[green]$(get_pwd) $fg[red]$(git_prompt_info)$reset_color$(put_spacing)$fg[green][%*] | |
$fg[red]» $reset_color' | |
ZSH_THEME_GIT_PROMPT_PREFIX="$fg[red]‹" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="$fg[red]›$reset_color" | |
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[green]±" | |
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]✓" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment