Skip to content

Instantly share code, notes, and snippets.

@goyalankit
Last active December 27, 2015 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyalankit/7294077 to your computer and use it in GitHub Desktop.
Save goyalankit/7294077 to your computer and use it in GitHub Desktop.
Customized imajes theme. Minimalistic version.
# Found on the ZshWiki
# http://zshwiki.org/home/config/prompt
#
# Author: Ankit Goyal @_goyalankit
#
#Mimalistic Version(2 lines)
#PROMPT="%{$fg[red]%}%%%{$reset_color%} "
#RPROMPT='${time} %{$fg[cyan]%}%c%{$reset_color%}%{$reset_color%}'
grey='\e[0;90m'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
function josh_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "
branch=$(current_branch)
ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
path_size=${#PWD}
branch_size=${#branch}
ruby_size=${#ruby_version}
user_machine_size=${#${(%):-%n@%m-}}
if [[ ${#branch} -eq 0 ]]
then (( ruby_size = ruby_size + 1 ))
else
(( branch_size = branch_size + 4 ))
if [[ -n $(git status -s 2> /dev/null) ]]; then
(( branch_size = branch_size + 2 ))
fi
fi
(( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
while [ ${#prompt} -lt $spare_width ]; do
prompt=" $prompt"
done
prompt="%{%F{green}%}$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)"
echo $prompt
}
PROMPT=" %{$fg[red]%}%%%{$reset_color%} "
RPROMPT='${time}$(josh_prompt) %{$fg[cyan]%}%c%{$reset_color%}%{$reset_color%}'
@goyalankit
Copy link
Author

Screenshots

alt text

alt text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment