Robby Russell
14 years ago
4 changed files with 93 additions and 2 deletions
@ -0,0 +1,43 @@
@@ -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]%}" |
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
# ------------------------------------------------------------------------------ |
||||
# FILE: sorin.zsh-theme |
||||
# DESCRIPTION: oh-my-zsh theme file. |
||||
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) |
||||
# VERSION: 1.0.2 |
||||
# SCREENSHOT: http://i.imgur.com/aipDQ.png |
||||
# ------------------------------------------------------------------------------ |
||||
|
||||
|
||||
if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then |
||||
MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" |
||||
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" |
||||
|
||||
PROMPT='%{$fg[cyan]%}%c$(git_prompt_info) %(!.%{$fg_bold[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} ' |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" |
||||
|
||||
RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}' |
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" |
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" |
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" |
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" |
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" |
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" |
||||
else |
||||
MODE_INDICATOR="❮❮❮" |
||||
local return_status="%(?::⏎)" |
||||
|
||||
PROMPT='%c$(git_prompt_info) %(!.#.❯) ' |
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" git:" |
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="" |
||||
ZSH_THEME_GIT_PROMPT_DIRTY="" |
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" |
||||
|
||||
RPROMPT='${return_status}$(git_prompt_status)' |
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED=" ✚" |
||||
ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" |
||||
ZSH_THEME_GIT_PROMPT_DELETED=" ✖" |
||||
ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" |
||||
ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" |
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" |
||||
fi |
Loading…
Reference in new issue