From 1e9b718af1a507e229c7cf25585c8a8c8b6c9415 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 1 Jun 2011 02:48:26 -0400 Subject: [PATCH] Cleaned up /lib/, removed trailing white space everywhere. --- lib/aliases.zsh | 96 +++++++++++++----------- lib/completion.zsh | 33 ++++---- lib/correction.zsh | 1 + lib/directories.zsh | 10 ++- lib/functions.zsh | 24 +++--- lib/git.zsh | 43 +++++++---- lib/grep.zsh | 10 ++- lib/history.zsh | 19 ++--- lib/key-bindings.zsh | 20 +++-- lib/misc.zsh | 20 +++-- lib/rvm.zsh | 9 ++- lib/spectrum.zsh | 20 ++--- lib/termsupport.zsh | 41 ++++++---- lib/theme-and-appearance.zsh | 40 ++++------ oh-my-zsh.sh | 50 ++++++------ plugins/compleat/compleat.plugin.zsh | 4 +- plugins/dirpersist/dirpersist.plugin.zsh | 6 +- plugins/extract/extract.plugin.zsh | 8 +- plugins/git-flow/git-flow.plugin.zsh | 2 +- plugins/git/git.plugin.zsh | 21 +----- plugins/gnu-utils/gnu-utils.plugin.zsh | 6 +- plugins/macports/_port | 8 +- plugins/osx/osx.plugin.zsh | 6 +- plugins/perl/perl.plugin.zsh | 2 +- plugins/redis-cli/_redis-cli | 2 +- plugins/rvm/_rvm | 4 +- plugins/svn/svn.plugin.zsh | 8 +- plugins/vagrant/_vagrant | 6 +- plugins/vi-mode/vi-mode.plugin.zsh | 2 +- templates/zshrc.zsh-template | 29 ++++--- themes/Soliah.zsh-theme | 10 +-- themes/awesomepanda.zsh-theme | 2 +- themes/cloud.zsh-theme | 2 +- themes/eastwood.zsh-theme | 2 +- themes/evan.zsh-theme | 2 +- themes/example.zsh-theme | 2 +- themes/funky.zsh-theme | 2 +- themes/gallois.zsh-theme | 2 +- themes/imajes.zsh-theme | 2 +- themes/jonathan.zsh-theme | 20 ++--- themes/josh.zsh-theme | 8 +- themes/juanghurtado.zsh-theme | 2 +- themes/kardan.zsh-theme | 2 +- themes/linuxonly | 6 +- themes/mikeh.zsh-theme | 2 +- themes/minimal.zsh-theme | 2 +- themes/rixius.zsh-theme | 2 +- themes/sorin.zsh-theme | 6 +- themes/theunraveler.zsh-theme | 2 +- themes/tonotdo.zsh-theme | 2 +- 50 files changed, 332 insertions(+), 298 deletions(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index a529f816..0cfafc6e 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -1,32 +1,35 @@ # The 'ls' family # ------------------------------------------------------------------------------ -[[ "$DISABLE_COLOR" != 'true' ]] && { - [[ -x "${commands[gdircolors]}" ]] && use_color_gnu='true' || use_color_bsd='true' -} - -[[ "$use_color_gnu" == 'true' && -e "$HOME/.dir_colors" ]] && eval $(gdircolors $HOME/.dir_colors) -[[ "$use_color_bsd" == 'true' ]] && export CLICOLOR=1 -[[ "$use_color_bsd" == 'true' ]] && export LSCOLORS="exfxcxdxbxegedabagacad" - -# add colors for filetype recognition -[[ "$use_color_gnu" == 'true' ]] && alias ls='ls -hF --group-directories-first --color=auto' -[[ "$use_color_bsd" == 'true' ]] && alias ls='ls -G -F' +if [[ "$DISABLE_COLOR" != 'true' ]]; then + if (( ${+commands[dircolors]} )); then + dircolors="${commands[dircolors]}" + fi + if (( ${+commands[gdircolors]} )); then + dircolors="${commands[gdircolors]}" + fi + if [[ -x "$dircolors" ]] && [[ -e "$HOME/.dir_colors" ]]; then + eval $("$dircolors" "$HOME/.dir_colors") + alias ls='ls -hF --group-directories-first --color=auto' + else + export CLICOLOR=1 + export LSCOLORS="exfxcxdxbxegedabagacad" + alias ls='ls -G -F' + fi +fi -alias ll='ls -lh' # show human readable -alias la='ls -lhA' # show hidden files -alias lx='ls -lhXB' # sort by extension -alias lk='ls -lhSr' # sort by size, biggest last -alias lc='ls -lhtcr' # sort by and show change time, most recent last -alias lu='ls -lhtur' # sort by and show access time, most recent last -alias lt='ls -lhtr' # sort by date, most recent last -alias lm='ls -lha | more' # pipe through 'more' -alias lr='ls -lhR' # recursive ls -alias sl='ls' # often screw this up +alias ll='ls -lh' # Show human readable. +alias la='ls -lhA' # Show hidden files. +alias lx='ls -lhXB' # Sort by extension. +alias lk='ls -lhSr' # Sort by size, biggest last. +alias lc='ls -lhtcr' # Sort by and show change time, most recent lasa. +alias lu='ls -lhtur' # Sort by and show access time, most recent last. +alias lt='ls -lhtr' # Sort by date, most recent last. +alias lm='ls -lha | more' # Pipe through 'more'. +alias lr='ls -lhR' # Recursive ls. +alias sl='ls' # I often screw this up. # General # ------------------------------------------------------------------------------ -alias ...='cd ../..' -alias -- -='cd -' alias rm='nocorrect rm -i' alias cp='nocorrect cp -i' alias mv='nocorrect mv -i' @@ -38,20 +41,13 @@ alias pu='pushd' alias po='popd' alias _='sudo' alias e="$EDITOR" -alias q='exit' alias history='fc -l 1' -alias h='history' -alias j='jobs -l' -alias f='fg' -alias gr='grep -r' alias get='curl -C - -O' -alias afind='ack-grep -il' +alias afind='ack -il' alias type='type -a' alias ssh='ssh -X' alias print-path='echo -e ${PATH//:/\\n}' -alias print-libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}' -alias lsbom='lsbom -f -l -s -pf' -alias t="$HOME/.local/bin/t --task-dir ~/.tasks --list todo.txt --delete-if-empty" +alias t="t --task-dir ~/.tasks --list todo.txt --delete-if-empty" if [[ -x "${commands[htop]}" ]]; then alias top=htop @@ -60,24 +56,38 @@ else alias topc='top -o cpu' fi -[[ "$DISABLE_COLOR" != 'true' ]] && { - [[ -x "${commands[colordiff]}" ]] && alias diff='colordiff' - [[ -x "${commands[colormake]}" ]] && alias make='colormake' -} +if [[ "$DISABLE_COLOR" != 'true' ]]; then + if [[ -x "${commands[colordiff]}" ]]; then + alias diff='colordiff' + fi + + if [[ -x "${commands[colormake]}" ]]; then + alias make='colormake' + fi +fi -# Screen +# Terminal Multiplexer # ------------------------------------------------------------------------------ -[[ "$TERM" == 'xterm-color' && -e "$HOME/.screenrc" ]] && screenrc="-c '$HOME/.screenrc'" -[[ "$TERM" == 'xterm-256color' && -e "$HOME/.screenrc256" ]] && screenrc="-c '$HOME/.screenrc256'" +local screenrc tmuxconf +if [[ "$TERM" == 'xterm-color' ]]; then + if [[ -e "$HOME/.screenrc" ]]; then + screenrc="-c '$HOME/.screenrc'" + tmuxconf="-f '$HOME/.tmux.conf'" + fi +fi + +if [[ "$TERM" == 'xterm-256color' ]]; then + if [[ -e "$HOME/.screenrc256" ]]; then + screenrc="-c '$HOME/.screenrc256'" + tmuxconf="-f '$HOME/.tmux256.conf'" + fi +fi + alias screen="screen $screenrc" alias sl="screen $screenrc -list" alias sr="screen $screenrc -a -A -U -D -R" alias S="screen $screenrc -U -S" -# TMUX -# ------------------------------------------------------------------------------ -[[ "$TERM" == 'xterm-color' && -e "$HOME/.tmux.conf" ]] && tmuxconf="-f '$HOME/.tmux.conf'" -[[ "$TERM" == 'xterm-256color' && -e "$HOME/.tmux256.conf" ]] && tmuxconf="-f '$HOME/.tmux256.conf'" alias tmux="tmux $tmuxconf" alias tls="tmux list-sessions" diff --git a/lib/completion.zsh b/lib/completion.zsh index 7c81f77b..c60faf63 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -1,19 +1,21 @@ -# fixme - the load process here seems a bit bizarre -[[ "$TERM" == "dumb" ]] && return +# Dumb terminals lack support. +if [[ "$TERM" == 'dumb' ]]; then + return +fi -unsetopt menu_complete # do not autoselect the first completion entry -unsetopt flowcontrol -setopt auto_menu # show completion menu on succesive tab press -setopt complete_in_word -setopt always_to_end +unsetopt menu_complete # Do not autoselect the first completion entry. +unsetopt flow_control # Disable start/stop characters in shell editor. +setopt auto_menu # Show completion menu on a succesive tab press. +setopt complete_in_word # Complete from both ends of a word. +setopt always_to_end # Move cursor to the end of a completed word. WORDCHARS='' -# fixme - complist is crashing ZSH on menu completion +# FIXME: complist is crashing ZSH on menu completion. # zmodload -i zsh/complist -## case-insensitive (all),partial-word and then substring completion -if [ "x$CASE_SENSITIVE" = "xtrue" ]; then +## Case-insensitive (all), partial-word, and then substring completion. +if [[ "$CASE_SENSITIVE" == "true" ]]; then zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' unset CASE_SENSITIVE else @@ -22,18 +24,19 @@ fi zstyle ':completion:*' list-colors '' -# should this be in keybindings? +# FIXME: It depends on complist which crashes ZSH on menu completion. +# Should this be in key-bindings.zsh? # bindkey -M menuselect '^o' accept-and-infer-next-history zstyle ':completion:*:*:*:*:*' menu select zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" -# disable named-directories autocompletion +# Disable named-directories autocompletion. zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories cdpath=(.) -# use /etc/hosts and known_hosts for hostname completion +# Use /etc/hosts and known_hosts for hostname completion. [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$( /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" + local branch=$(git_current_branch) + if [[ -n "$branch" ]]; then + echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${branch}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" + fi +} + +# Gets the current branch. +function git_current_branch() { + local ref=$(git symbolic-ref HEAD 2> /dev/null) + if [[ -n "$ref" ]]; then + echo "${ref#refs/heads/}" + fi } -# Checks if working tree is dirty -parse_git_dirty() { +# Checks if the working tree is dirty. +function parse_git_dirty() { if [[ -n $(git status -s 2> /dev/null) ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else @@ -13,25 +23,31 @@ parse_git_dirty() { fi } -# Checks if there are commits ahead from remote +# Checks if there are commits ahead from remote. function git_prompt_ahead() { - if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + if $(echo "$(git log origin/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi } -# Formats prompt string for current git commit short SHA +# Formats the prompt string for current git commit short SHA. function git_prompt_short_sha() { - SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" + local sha=$(git rev-parse --short HEAD 2> /dev/null) + if [[ -n "$sha" ]]; then + echo "${ZSH_THEME_GIT_PROMPT_SHA_BEFORE}${sha}${ZSH_THEME_GIT_PROMPT_SHA_AFTER}" + fi } -# Formats prompt string for current git commit long SHA +# Formats the prompt string for current git commit long SHA. function git_prompt_long_sha() { - SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" + local sha=$(git rev-parse HEAD 2> /dev/null) + if [[ -n "$sha" ]]; then + echo "${ZSH_THEME_GIT_PROMPT_SHA_BEFORE}${sha}${ZSH_THEME_GIT_PROMPT_SHA_AFTER}" + fi } -# Get the status of the working tree -git_prompt_status() { +# Gets the status of the working tree. +function git_prompt_status() { local indicators line untracked added modified renamed deleted while IFS=$'\n' read line; do if [[ "$line" =~ '^\?\? ' ]]; then @@ -61,3 +77,4 @@ git_prompt_status() { done < <(git status --porcelain 2> /dev/null) echo $indicators } + diff --git a/lib/grep.zsh b/lib/grep.zsh index 3e1f213e..75cfc292 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -1,6 +1,10 @@ -if [[ "$DISABLE_COLOR" != "true" ]]; then - export GREP_OPTIONS='--color=auto' - export GREP_COLOR='37;45' +if [[ "$DISABLE_COLOR" != 'true' ]]; then + if [[ -z "$GREP_OPTIONS" ]]; then + export GREP_OPTIONS='--color=auto' + fi + if [[ -z "$GREP_COLOR" ]]; then + export GREP_COLOR='37;45' + fi else export GREP_OPTIONS='--color=none' export GREP_COLOR='' diff --git a/lib/history.zsh b/lib/history.zsh index 604658a5..8a32e339 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,13 +1,14 @@ ## Command history configuration -HISTFILE=$HOME/.zsh_history +HISTFILE="$HOME/.zsh_history" HISTSIZE=10000 SAVEHIST=10000 -setopt HIST_VERIFY -setopt HIST_EXPIRE_DUPS_FIRST -setopt HIST_IGNORE_SPACE -setopt HIST_IGNORE_DUPS -setopt SHARE_HISTORY -setopt APPEND_HISTORY -setopt EXTENDED_HISTORY -setopt INC_APPEND_HISTORY +setopt hist_verify +setopt hist_expire_dups_first +setopt hist_ignore_space +setopt hist_ignore_dups +setopt share_history +setopt append_history +setopt extended_history +setopt inc_append_history + diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 9f28d576..fd795ed7 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -1,4 +1,4 @@ -# TODO: Explain what some of this does.. +# TODO: Write a GNU Emacs key bindings file akin to the vi-mode plugin. bindkey -e bindkey '\ew' kill-region @@ -8,7 +8,7 @@ bindkey '^r' history-incremental-search-backward bindkey "^[[5~" up-line-or-history bindkey "^[[6~" down-line-or-history -# make search up and down work, so partially type and hit up/down to find relevant stuff +# Make key up/down move up/down or search history. bindkey '^[[A' up-line-or-search bindkey '^[[B' down-line-or-search @@ -16,18 +16,22 @@ bindkey "^[[H" beginning-of-line bindkey "^[[1~" beginning-of-line bindkey "^[[F" end-of-line bindkey "^[[4~" end-of-line -bindkey ' ' magic-space # also do history expansion on space +# Do history expansion on space. +bindkey ' ' magic-space + +# File rename magick. +bindkey "^[m" copy-prev-shell-word bindkey '^[[Z' reverse-menu-complete -# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ +# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~. bindkey "^[[3~" delete-char bindkey "^[3;5~" delete-char bindkey "\e[3~" delete-char -# consider emacs keybindings: +# Consider GNU Emacs keybindings: -#bindkey -e ## emacs key bindings +#bindkey -e # Emacs key bindings. # #bindkey '^[[A' up-line-or-search #bindkey '^[[B' down-line-or-search @@ -40,6 +44,6 @@ bindkey "\e[3~" delete-char #bindkey '^X^N' accept-and-infer-next-history #bindkey '^W' kill-region #bindkey '^I' complete-word -## Fix weird sequence that rxvt produces +## FIXME: A weird sequence that rxvt produces #bindkey -s '^[[Z' '\t' -# + diff --git a/lib/misc.zsh b/lib/misc.zsh index 364ad879..efc38400 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -1,13 +1,17 @@ -## smart urls +# Smart URLs autoload -U url-quote-magic zle -N self-insert url-quote-magic -## file rename magick -bindkey "^[m" copy-prev-shell-word - -## jobs +# Jobs setopt long_list_jobs -## pager -[[ -z "$PAGER" ]] && export PAGER=less -[[ -z "$LC_CTYPE" ]] && export LC_CTYPE=en_US.UTF-8 +# Pager +if [[ -z "$PAGER" ]]; then + export PAGER=less +fi + +# Localization +if [[ -z "$LC_CTYPE" ]]; then + export LC_CTYPE=en_US.UTF-8 +fi + diff --git a/lib/rvm.zsh b/lib/rvm.zsh index 597be1b3..25ba36b7 100644 --- a/lib/rvm.zsh +++ b/lib/rvm.zsh @@ -1,7 +1,8 @@ -# get the name of the branch we are on +# Get the name of the current branch. function rvm_prompt_info() { - ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return - echo "($ruby_version)" + local ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) + if [[ -n "$ruby_version" ]]; then + echo "($ruby_version)" + fi } - diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 4006a7fe..43a013d7 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -1,20 +1,20 @@ -#! /bin/zsh -# A script to make using 256 colors in zsh less painful. +# A script to make using 256 colors in ZSH less painful. # P.C. Shyamshankar # Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ typeset -Ag FX FG BG FX=( - reset "%{%}" - bold "%{%}" no-bold "%{%}" - italic "%{%}" no-italic "%{%}" - underline "%{%}" no-underline "%{%}" - blink "%{%}" no-blink "%{%}" - reverse "%{%}" no-reverse "%{%}" + reset "%{%}" + bold "%{%}" no-bold "%{%}" + italic "%{%}" no-italic "%{%}" + underline "%{%}" no-underline "%{%}" + blink "%{%}" no-blink "%{%}" + reverse "%{%}" no-reverse "%{%}" ) for color in {000..255}; do - FG[$color]="%{[38;5;${color}m%}" - BG[$color]="%{[48;5;${color}m%}" + FG[$color]="%{[38;5;${color}m%}" + BG[$color]="%{[48;5;${color}m%}" done + diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 9a576570..5c1c812d 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -1,31 +1,40 @@ -[[ "$TERM" == "dumb" ]] && return +# Dumb terminals lack support. +if [[ "$TERM" == 'dumb' ]]; then + return +fi -#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title -#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1 -#Fully support screen, iterm, and probably most modern xterm and rxvt -#Limited support for Apple Terminal (Terminal can't set window or tab separately) +# Fully supports GNU Screen, iTerm, and most modern xterm and rxvt terminals. +# Partially supports Mac OS X Terminal since it can't set window and tab separately. +# Usage: title "tab title" "window title" function title { - [ "$DISABLE_AUTO_TITLE" != "true" ] || return - if [[ "$TERM" == screen* ]]; then - print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars - elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then - print -Pn "\e]2;$2:q\a" #set window name - print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) + if [[ "$DISABLE_AUTO_TITLE" != 'true' ]]; then + if [[ "$TERM" == screen* ]]; then + # Set GNU Screen's hardstatus (usually truncated at 20 characters). + print -Pn "\ek$1:q\e\\" + elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]]; then + # Set the window title. + print -Pn "\e]2;$2:q\a" + # Set the tab title (will override window title on a broken terminal). + print -Pn "\e]1;$1:q\a" + fi fi } -ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD +# 15 character, left-truncated current working directory. +ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" -#Appears when you have the prompt +# Set the tab and window titles before the prompt is displayed. function precmd { - title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE + title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE" } -#Appears at the beginning of (and during) of command execution +# Set the tab and window titles before command execution. function preexec { emulate -L zsh setopt extended_glob - local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd + # Command name only, or if this is sudo or ssh, the next command. + local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} title "$CMD" "%100>...>$2%<<" } + diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index ab5aba4d..2596013b 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -1,35 +1,23 @@ -# ls colors -autoload colors; colors; -[[ -z "$LSCOLORS" ]] && export LSCOLORS="Gxfxcxdxbxegedabagacad" +# Load and run colors. +autoload -U colors +colors -i -# Enable ls colors -if [ "$DISABLE_COLOR" != "true" ] -then - # Find the option for using colors in ls, depending on the version: Linux or BSD - ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G' -fi - -#setopt no_beep -setopt auto_cd -setopt multios -setopt cdablevarS - -if [[ x$WINDOW != x ]] -then - SCREEN_NO="%B$WINDOW%b " +# Set the GNU Screen window number. +if [[ -n "$WINDOW" ]]; then + SCREEN_NO="%B$WINDOW%b " else - SCREEN_NO="" + SCREEN_NO="" fi -# Apply theming defaults +# Set the default prompt theme. PS1="%n@%m:%~%# " -# git theming default: Variables for theming the git info prompt -ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name -ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt -ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty -ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean +# Set the default Git prompt theme. +ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix before the branch name. +ZSH_THEME_GIT_PROMPT_SUFFIX=")" # Suffix after the branch name. +ZSH_THEME_GIT_PROMPT_DIRTY="*" # Indicator to display if the branch is dirty. +ZSH_THEME_GIT_PROMPT_CLEAN="" # Indicator to display if the branch is clean. -# Setup the prompt with pretty colors +# Enable parameter, arithmentic expansion and command substitution in prompt. setopt prompt_subst diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index b0b7d395..e67c2df6 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,45 +1,45 @@ -# Initializes Oh My Zsh +# Initializes OH MY ZSH. -# Disable colors on dumb terminals -if [ "$TERM" = "dumb" ]; then - DISABLE_COLOR="true" +# Disable color in dumb terminals. +if [[ "$TERM" == 'dumb' ]]; then + DISABLE_COLOR='true' fi -# Load all of the config files in ~/oh-my-zsh that end in .zsh -# TIP: Add files you don't want in git to .gitignore -for config_file ($ZSH/lib/*.zsh) source $config_file +# Load all files in $ZSH/oh-my-zsh/lib/ that end in .zsh. +for config_file in $ZSH/lib/*.zsh; do + source "$config_file" +done -# Add all defined plugins to fpath +# Add all defined plugins to fpath. plugin=${plugin:=()} -for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) +for plugin in $plugins; do + fpath=($ZSH/plugins/$plugin $fpath) +done -# Load and run compinit +# Load and run compinit. autoload -U compinit compinit -i -# Load all of the plugins that were defined in ~/.zshrc -for plugin ($plugins); do - if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH/plugins/$plugin/$plugin.plugin.zsh +# Load all plugins defined in ~/.zshrc. +for plugin in $plugins; do + if [[ -f "$ZSH/plugins/$plugin/$plugin.plugin.zsh" ]]; then + source "$ZSH/plugins/$plugin/$plugin.plugin.zsh" fi done -# Load the theme -# Check for updates on initial load... -if [ "$ZSH_THEME" = "random" ] -then - themes=($ZSH/themes/*zsh-theme) - N=${#themes[@]} - ((N=(RANDOM%N)+1)) - RANDOM_THEME=${themes[$N]} - source "$RANDOM_THEME" - echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." +# Load the theme. +if [[ "$ZSH_THEME" == "random" ]]; then + themes=($ZSH/themes/*.zsh-theme) + theme_index=${#themes[@]} + (( theme_index=((RANDOM % theme_index) + 1) )) + random_theme="${themes[$theme_index]}" + source "$random_theme" else source "$ZSH/themes/$ZSH_THEME.zsh-theme" fi # Compile zcompdump, if modified, to increase startup speed. -if [ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" -o ! -e "$HOME/.zcompdump.zwc" ]; then +if [[ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" ]] || [[ ! -e "$HOME/.zcompdump.zwc" ]]; then zcompile "$HOME/.zcompdump" fi diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/compleat.plugin.zsh index 38f1b396..7fbd2b95 100644 --- a/plugins/compleat/compleat.plugin.zsh +++ b/plugins/compleat/compleat.plugin.zsh @@ -7,7 +7,7 @@ if (( ${+commands[compleat]} )); then local prefix="${commands[compleat]:h:h}" - local setup="${prefix}/share/compleat-1.0/compleat_setup" + local setup="${prefix}/share/compleat-1.0/compleat_setup" if [[ -f "$setup" ]]; then if ! bashcompinit >/dev/null 2>&1; then @@ -15,6 +15,6 @@ if (( ${+commands[compleat]} )); then bashcompinit -i fi - source "$setup" + source "$setup" fi fi diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh index 6a2b289a..baf21b1d 100644 --- a/plugins/dirpersist/dirpersist.plugin.zsh +++ b/plugins/dirpersist/dirpersist.plugin.zsh @@ -1,9 +1,9 @@ #!/bin/zsh -# +# # Make the dirstack more persistant -# +# # Add dirpersist to $plugins in ~/.zshrc to load -# +# # $zdirstore is the file used to persist the stack zdirstore=~/.zdirstore diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index d2b28ad1..aa55234a 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -23,7 +23,7 @@ function extract() { remove_archive=1 if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then - remove_archive=0 + remove_archive=0 shift fi @@ -64,10 +64,10 @@ function extract() { cd ..; rm *.tar.gz debian-binary cd .. ;; - (*) + (*) echo "extract: '$1' cannot be extracted" 1>&2 - success=1 - ;; + success=1 + ;; esac (( success = $success > 0 ? $success : $? )) diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index 270bcbe3..a889473e 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -329,4 +329,4 @@ __git_command_successful () { return 0 } -zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' \ No newline at end of file +zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index bc340e86..6f0ce28c 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,4 +1,3 @@ -# Aliases alias g='git' compdef g=git alias gst='git status' @@ -27,24 +26,12 @@ alias gcp='git cherry-pick' compdef _git gcp=git-cherry-pick alias glg='git log --stat --max-count=5' compdef _git glg=git-log - -# Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' compdef git-svn-dcommit-push=git - -# -# Will return the current branch name -# Usage example: git pull origin $(current_branch) -# -function current_branch() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo ${ref#refs/heads/} -} - -# these aliases take advantage of the previous function -alias ggpull='git pull origin $(current_branch)' +alias ggpull='git pull origin $(git_current_branch)' compdef ggpull=git -alias ggpush='git push origin $(current_branch)' +alias ggpush='git push origin $(git_current_branch)' compdef ggpush=git -alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' +alias ggpnp='git pull origin $(git_current_branch) && git push origin $(git_current_branch)' compdef ggpnp=git + diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh index e59265d6..28317ff9 100644 --- a/plugins/gnu-utils/gnu-utils.plugin.zsh +++ b/plugins/gnu-utils/gnu-utils.plugin.zsh @@ -6,7 +6,7 @@ # ------------------------------------------------------------------------------ -if [[ -x "${commands[gwhoami]}" ]]; then +if [[ -x "${commands[gwhoami]}" ]]; then __gnu_utils() { emulate -L zsh local gcmds @@ -14,7 +14,7 @@ if [[ -x "${commands[gwhoami]}" ]]; then local cmd local prefix - # coreutils + # coreutils gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod' 'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate' 'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand' @@ -35,7 +35,7 @@ if [[ -x "${commands[gwhoami]}" ]]; then for gcmd in "${gcmds[@]}"; do # # This method allows for builtin commands to be primary but it's - # lost if hash -r or rehash -f is executed. Thus, those two + # lost if hash -r or rehash -f is executed. Thus, those two # functions have to be wrapped. # (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]} diff --git a/plugins/macports/_port b/plugins/macports/_port index 06d7fb42..c4de6eab 100644 --- a/plugins/macports/_port +++ b/plugins/macports/_port @@ -1,6 +1,6 @@ #compdef port -local subcmds +local subcmds # we cache the list of ports # we shall use some cache policy to avoid problems with new ports @@ -31,8 +31,8 @@ subcmds=( 'file' 'help' 'info' -'install' -'installed' +'install' +'installed' 'list' 'livecheck' 'location' @@ -48,7 +48,7 @@ subcmds=( 'test' 'unarchive' 'uninstall' -'upgrade' +'upgrade' 'variants' 'version' ) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 62f7ccd7..682bb266 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -44,7 +44,7 @@ EOF } function pfd() { - osascript 2>/dev/null </dev/null </dev/null </dev/null </dev/null) - if [ $s ]; then + if [ $s ]; then echo $1 - else + else echo $2 fi fi @@ -39,4 +39,4 @@ function svn_dirty_choose { function svn_dirty { svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN -} \ No newline at end of file +} diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 483b29c5..2e76d2ec 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -1,4 +1,4 @@ -#compdef vagrant +#compdef vagrant #autoload # vagrant zsh completion @@ -64,7 +64,7 @@ __vagrant-box () (options) case $line[1] in (repackage|remove) - _arguments ':feature:__box_list' + _arguments ':feature:__box_list' ;; esac ;; @@ -93,7 +93,7 @@ case $state in (options) case $line[1] in (help) - _arguments ':feature:__task_list' + _arguments ':feature:__task_list' ;; (box) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 019fc1d7..f9d50d2e 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -52,7 +52,7 @@ bindkey -v # Use vi key bindings. bindkey -M vicmd "^M" accept_line # Alow RETURN in vi command. bindkey -M vicmd v edit-command-line # ESC-v to edit in an external editor. -bindkey ' ' magic-space +bindkey ' ' magic-space bindkey -M vicmd "gg" beginning-of-history bindkey -M vicmd "G" end-of-history diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index c2accfc8..6746feb2 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -1,25 +1,24 @@ -# Path to your oh-my-zsh configuration. -export ZSH=$HOME/.oh-my-zsh +# Path to oh-my-zsh. +export ZSH="$HOME/.oh-my-zsh" -# Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ -# Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. +# Set the name of the theme to load (see $ZSH/themes/). +# Setting it to 'random' loads a random theme. export ZSH_THEME="robbyrussell" -# Set to this to use case-sensitive completion -# export CASE_SENSITIVE="true" +# Set to 'true' to enable case-sensitivity. +export CASE_SENSITIVE='false' -# Uncomment following line if you want to disable colors in ls -# export DISABLE_COLOR="true" +# Set to 'true' to disable color (auto set on dumb terminals). +export DISABLE_COLOR='false' -# Uncomment following line if you want to disable autosetting terminal title. -# export DISABLE_AUTO_TITLE="true" +# Set to 'true' to disable auto setting the tab and window titles. +export DISABLE_AUTO_TITLE='false' -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Example format: plugins=(rails git textmate ruby lighthouse) +# Set the plugins to load (see $ZSH/plugins/). +# Example: plugins=(rails git textmate ruby lighthouse) plugins=(git) -source $ZSH/oh-my-zsh.sh +source "$ZSH/oh-my-zsh.sh" # Customize to your needs... + diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme index 237e70fd..e0932c4b 100644 --- a/themes/Soliah.zsh-theme +++ b/themes/Soliah.zsh-theme @@ -5,10 +5,10 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" # Text to display if the branch is dirty -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" # Text to display if the branch is clean -ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_CLEAN="" # Colors vary depending on time lapsed. ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" @@ -35,7 +35,7 @@ function rvm_gemset() { GEMSET=`rvm gemset list | grep '=>' | cut -b4-` if [[ -n $GEMSET ]]; then echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" - fi + fi } @@ -53,12 +53,12 @@ function git_time_since_commit() { # Totals MINUTES=$((seconds_since_last_commit / 60)) HOURS=$((seconds_since_last_commit/3600)) - + # Sub-hours and sub-minutes DAYS=$((seconds_since_last_commit / 86400)) SUB_HOURS=$((HOURS % 24)) SUB_MINUTES=$((MINUTES % 60)) - + if [[ -n $(git status -s 2> /dev/null) ]]; then if [ "$MINUTES" -gt 30 ]; then COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" diff --git a/themes/awesomepanda.zsh-theme b/themes/awesomepanda.zsh-theme index 411b8983..1915bd13 100644 --- a/themes/awesomepanda.zsh-theme +++ b/themes/awesomepanda.zsh-theme @@ -15,4 +15,4 @@ ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" ZSH_THEME_SVN_PROMPT_SUFFIX=")" ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" -ZSH_THEME_SVN_PROMPT_CLEAN=" " \ No newline at end of file +ZSH_THEME_SVN_PROMPT_CLEAN=" " diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme index ad5e2834..4e94f61a 100644 --- a/themes/cloud.zsh-theme +++ b/themes/cloud.zsh-theme @@ -3,4 +3,4 @@ PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]" \ No newline at end of file +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]" diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme index 83664515..8f15f367 100644 --- a/themes/eastwood.zsh-theme +++ b/themes/eastwood.zsh-theme @@ -1,5 +1,5 @@ #RVM settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then +if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" fi diff --git a/themes/evan.zsh-theme b/themes/evan.zsh-theme index 5ef1f40d..2ebb2715 100644 --- a/themes/evan.zsh-theme +++ b/themes/evan.zsh-theme @@ -1,2 +1,2 @@ # Evan describes this sexy prompt as: "a skinny, topless prompt" -PROMPT='%m :: %2~ %B»%b ' \ No newline at end of file +PROMPT='%m :: %2~ %B»%b ' diff --git a/themes/example.zsh-theme b/themes/example.zsh-theme index dbd9dc9c..4ad3b7ca 100644 --- a/themes/example.zsh-theme +++ b/themes/example.zsh-theme @@ -2,4 +2,4 @@ # http://zshwiki.org/home/config/prompt # -PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " \ No newline at end of file +PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " diff --git a/themes/funky.zsh-theme b/themes/funky.zsh-theme index 2451296d..50345548 100644 --- a/themes/funky.zsh-theme +++ b/themes/funky.zsh-theme @@ -11,4 +11,4 @@ local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color PROMPT="╭─${path_p}─${user_host}─${ret_status}─${hist_no} ╰─${blue_op}${smiley}${blue_cp} %# " local cur_cmd="${blue_op}%_${blue_cp}" -PROMPT2="${cur_cmd}> " \ No newline at end of file +PROMPT2="${cur_cmd}> " diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index 259640ba..be8fe099 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -12,7 +12,7 @@ git_custom_status() { } #RVM and git settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then +if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' fi diff --git a/themes/imajes.zsh-theme b/themes/imajes.zsh-theme index 88c35b6d..918cd808 100644 --- a/themes/imajes.zsh-theme +++ b/themes/imajes.zsh-theme @@ -2,4 +2,4 @@ # http://zshwiki.org/home/config/prompt # -PROMPT="%{$fg[red]%}%%%{$reset_color%} " \ No newline at end of file +PROMPT="%{$fg[red]%}%%%{$reset_color%} " diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index add48527..79d0d21f 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -5,15 +5,15 @@ function precmd { ### # Truncate the path if it's too long. - + PR_FILLBAR="" PR_PWDLEN="" - + local promptsize=${#${(%):---(%n@%m:%l)---()--}} local rubyprompt=`rvm_prompt_info` local rubypromptsize=${#${rubyprompt}} local pwdsize=${#${(%):-%~}} - + if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then ((PR_PWDLEN=$TERMWIDTH - $promptsize)) else @@ -69,7 +69,7 @@ setprompt () { ### # See if we can use extended characters to look nicer. - + typeset -A altchar set -A altchar ${(s..)terminfo[acsc]} PR_SET_CHARSET="%{$terminfo[enacs]%}" @@ -81,10 +81,10 @@ setprompt () { PR_LRCORNER=${altchar[j]:--} PR_URCORNER=${altchar[k]:--} - + ### # Decide if we need to set titlebar text. - + case $TERM in xterm*) PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}' @@ -96,8 +96,8 @@ setprompt () { PR_TITLEBAR='' ;; esac - - + + ### # Decide whether to set a screen title if [[ "$TERM" == "screen" ]]; then @@ -105,8 +105,8 @@ setprompt () { else PR_STITLE='' fi - - + + ### # Finally, the prompt. diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme index 6bed1a70..d6c64da8 100644 --- a/themes/josh.zsh-theme +++ b/themes/josh.zsh-theme @@ -15,7 +15,7 @@ function josh_prompt { branch_size=${#branch} ruby_size=${#ruby_version} user_machine_size=${#${(%):-%n@%m-}} - + if [[ ${#branch} -eq 0 ]] then (( ruby_size = ruby_size + 1 )) else @@ -24,15 +24,15 @@ function josh_prompt { (( 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}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)" - + echo $prompt } diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme index 2f715cc9..3ca50cee 100644 --- a/themes/juanghurtado.zsh-theme +++ b/themes/juanghurtado.zsh-theme @@ -43,4 +43,4 @@ ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" PROMPT=' %{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%} %{$BLUE%}>%{$RESET_COLOR%} ' -RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' \ No newline at end of file +RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' diff --git a/themes/kardan.zsh-theme b/themes/kardan.zsh-theme index fd6586a9..59c93803 100644 --- a/themes/kardan.zsh-theme +++ b/themes/kardan.zsh-theme @@ -9,4 +9,4 @@ RPROMPT='%~$(git_prompt_info)$(get_host)' ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}" ZSH_THEME_GIT_PROMPT_PREFIX="(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" \ No newline at end of file +ZSH_THEME_GIT_PROMPT_SUFFIX=")" diff --git a/themes/linuxonly b/themes/linuxonly index a11b80d7..335b2c4a 100644 --- a/themes/linuxonly +++ b/themes/linuxonly @@ -47,7 +47,7 @@ prompt_jnrowe_precmd () { #dir_status="$c1%n%F{7}@%F{9}%m%F{7}:%F{12}%/" dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" #dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$foopath%} %{$c0%}(%{$c5%}%?%{$c0%})" - + PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} > ' elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then @@ -55,7 +55,7 @@ prompt_jnrowe_precmd () { PROMPT='${vcs_info_msg_0_} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} > ' - + elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" @@ -67,7 +67,7 @@ prompt_jnrowe_precmd () { PROMPT='${vcs_info_msg_0_} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} > ' - + fi } diff --git a/themes/mikeh.zsh-theme b/themes/mikeh.zsh-theme index 943f04d3..e611b683 100644 --- a/themes/mikeh.zsh-theme +++ b/themes/mikeh.zsh-theme @@ -20,4 +20,4 @@ mikeh_precmd() { # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 PROMPT=$'%{\e[0;34m%}%B..[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} %{\e[0;34m%}%B..%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <($vcs_info_msg_0_)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' \ No newline at end of file +PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme index ee3ab6b2..d3c9e366 100644 --- a/themes/minimal.zsh-theme +++ b/themes/minimal.zsh-theme @@ -12,4 +12,4 @@ git_custom_status() { } -PROMPT='%2~ $(git_custom_status) »%b ' \ No newline at end of file +PROMPT='%2~ $(git_custom_status) »%b ' diff --git a/themes/rixius.zsh-theme b/themes/rixius.zsh-theme index c0c5c9c7..7e7c9c63 100644 --- a/themes/rixius.zsh-theme +++ b/themes/rixius.zsh-theme @@ -1,6 +1,6 @@ # /|/ Code by Stephen # /|/ "Rixius" Middleton -# +# # name in folder (github) # ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right. function collapse_pwd { diff --git a/themes/sorin.zsh-theme b/themes/sorin.zsh-theme index 33ca9c1e..a63a9844 100644 --- a/themes/sorin.zsh-theme +++ b/themes/sorin.zsh-theme @@ -10,7 +10,7 @@ if [[ "$DISABLE_COLOR" != "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]%}" @@ -26,10 +26,10 @@ if [[ "$DISABLE_COLOR" != "true" ]]; then ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" -else +else MODE_INDICATOR="❮❮❮" local return_status="%(?::⏎)" - + PROMPT='%c$(git_prompt_info) %(!.#.❯) ' ZSH_THEME_GIT_PROMPT_PREFIX=" git:" diff --git a/themes/theunraveler.zsh-theme b/themes/theunraveler.zsh-theme index e4bfb79c..a896970d 100644 --- a/themes/theunraveler.zsh-theme +++ b/themes/theunraveler.zsh-theme @@ -13,4 +13,4 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" \ No newline at end of file +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" diff --git a/themes/tonotdo.zsh-theme b/themes/tonotdo.zsh-theme index a6407034..52670e8a 100644 --- a/themes/tonotdo.zsh-theme +++ b/themes/tonotdo.zsh-theme @@ -9,4 +9,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}✗%{$fg_bold[blue]%})" # LS colors, made with http://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' \ No newline at end of file +export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'