Last active
August 29, 2015 13:59
-
-
Save ivoarch/10551997 to your computer and use it in GitHub Desktop.
Minimal 256color prompt for zsh users
This file contains hidden or 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
# PROMPT - themes for ZSH | |
# TODO: | |
# o add git support ? | |
# Set required options. | |
setopt promptsubst | |
local bold="%B" | |
local unbold="%b" | |
local standout="%S" | |
local unstandout="%s" | |
local colorfg="%F" | |
local uncolorfg="%f" | |
local colorbg="%K" | |
local uncolorbg="%k" | |
local full_path="%~" | |
local base_bath="%c" | |
local hostname="%M" | |
local username="%n" | |
local time="%T" | |
local date="%D" | |
local datetime="%D/%T" | |
local line_tty="%y" | |
local rootorwhat="%#" | |
local return_status="%(?.$colorfg{116}^_^%f.$colorfg{174}o_O)" | |
local running_tasks="%I" | |
# Powerline patched font (support!) | |
export PYTHONPATH=/usr/lib/python3.3/site-packages | |
RSEGF="" | |
RSEG="" | |
LSEGF="" | |
LSEG="" | |
BRNCH="" | |
# Load required modules for git info. | |
autoload add-zsh-hook | |
autoload -Uz vcs_info | |
# Configure vcs_info | |
zstyle ':vcs_info:*' enable git | |
# [comment] for Powerline users. | |
zstyle ':vcs_info:git*' formats '$colorbg{188}$colorfg{239} %b ± ' | |
# [uncomment] for Powerline users | |
#zstyle ':vcs_info:git*' formats '$colorbg{188}$colorfg{239} %b $BRNCH $colorbg{108}$colorfg{188}$RSEGF' | |
zstyle ':vcs_info:git*' actionformats '%b|%a' | |
function prompt_precmd() { vcs_info } | |
function set_prompt { | |
# [comment] for Powerline users. | |
PROMPT="${vcs_info_msg_0_}$colorbg{108}$colorfg{239} $hostname $uncolorbg$uncolorfg$colorbg{239}$colorfg{188} $full_path $uncolorbg$uncolorfg " | |
RPROMPT="$colorbg{240}$colorfg{188} $time $uncolorbg$uncolorfg" | |
# [uncomment] for powerline users. | |
# PROMPT="${vcs_info_msg_0_}$colorbg{108}$colorfg{239} $hostname $uncolorbg$uncolorfg$colorbg{239}$colorfg{108}$RSEGF$colorbg{239}$colorfg{188} $full_path $uncolorbg$colorfg{239}$RSEGF$uncolorbg$uncolorfg " | |
# RPROMPT="$colorfg{240}$LSEGF$colorbg{240}$colorfg{188} $time $uncolorfg$uncolorbg" | |
} | |
# Add hook for calling vcs_info before each command. | |
add-zsh-hook precmd prompt_precmd | |
add-zsh-hook precmd set_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screenshots:
Normal:
http://storage8.static.itmages.ru/i/14/0413/h_1397384973_4243790_437881dbd8.png
Powerline:
http://storage9.static.itmages.ru/i/14/0413/h_1397384978_6205173_28c08484b9.png