1
0
Fork 0

Merge branch 'theme-sorin' of https://github.com/sorin-ionescu/oh-my-zsh into sorin-ionescu-theme-sorin

pull/4/head
Robby Russell 14 years ago
commit d88a32fd7d

@ -8,7 +8,7 @@ h2. Setup
h3. The automatic installer... (do you trust me?)
@wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
@wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
h3. The manual way
@ -38,7 +38,7 @@ h2. Usage
* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
** example: @plugins=(git osx ruby)@
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
** Take a look at the "current themes":http://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
* much much more... take a look at @lib/@ what _Oh My Zsh_ offers...
h2. Useful

@ -0,0 +1,43 @@
#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
# Prompt for the Zsh shell:
# * One line.
# * VCS info on the right prompt.
# * Only shows the path on the left prompt by default.
# * Crops the path to a defined length and only shows the path relative to
# the current VCS repository root.
# * Wears a different color wether the last command succeeded/failed.
# * Shows user@hostname if connected through SSH.
# * Shows if logged in as root or not.
# ------------------------------------------------------------------------------
# Customizable parameters.
PROMPT_PATH_MAX_LENGTH=30
PROMPT_DEFAULT_END=
PROMPT_ROOT_END=
PROMPT_SUCCESS_COLOR=$FG[071]
PROMPT_FAILURE_COLOR=$FG[124]
PROMPT_VCS_INFO_COLOR=$FG[242]
# Set required options.
setopt promptsubst
# Load required modules.
autoload -U add-zsh-hook
autoload -Uz vcs_info
# Add hook for calling vcs_info before each command.
add-zsh-hook precmd vcs_info
# Set vcs_info parameters.
zstyle ':vcs_info:*' enable hg bzr git
zstyle ':vcs_info:*:*' check-for-changes true # Can be slow on big repos.
zstyle ':vcs_info:*:*' unstagedstr '!'
zstyle ':vcs_info:*:*' stagedstr '+'
zstyle ':vcs_info:*:*' actionformats "%S" "%r/%s/%b %u%c (%a)"
zstyle ':vcs_info:*:*' formats "%S" "%r/%s/%b %u%c"
zstyle ':vcs_info:*:*' nvcsformats "%~" ""
# Define prompts.
PROMPT="%(0?.%{$PROMPT_SUCCESS_COLOR%}.%{$PROMPT_FAILURE_COLOR%})${SSH_TTY:+[%n@%m]}%{$FX[bold]%}%$PROMPT_PATH_MAX_LENGTH<..<"'${vcs_info_msg_0_%%.}'"%<<%(!.$PROMPT_ROOT_END.$PROMPT_DEFAULT_END)%{$FX[no-bold]%}%{$FX[reset]%} "
RPROMPT="%{$PROMPT_VCS_INFO_COLOR%}"'$vcs_info_msg_1_'"%{$FX[reset]%}"
Loading…
Cancel
Save