forked from ohmyzsh/ohmyzsh
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
- Loading branch information
Showing
20 changed files
with
223 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ locals.zsh | |
log/.zsh_history | ||
projects.zsh | ||
custom/* | ||
!custom/example | ||
!custom/example.zsh | ||
cache |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Add your own custom plugins in the custom/plugins directory. Plugins placed | ||
# here will override ones with the same name in the main plugins directory. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alias brews='brew list -1' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ function _cap () { | |
fi | ||
} | ||
|
||
compctl -K _cap cap | ||
compctl -K _cap cap |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ if [ "$commands[(I)hub]" ]; then | |
# eval `hub alias -s zsh` | ||
function git(){hub "$@"} | ||
fi | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Open the node api for your current version to the optional section. | ||
# TODO: Make the section part easier to use. | ||
function node-docs { | ||
open "http://nodejs.org/docs/$(node --version)/api/all.html#$1" | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Thanks to Christopher Sexton | ||
# https://gist.github.com/965032 | ||
function kapow { | ||
touch ~/.pow/$1/tmp/restart.txt | ||
if [ $? -eq 0 ]; then | ||
echo "$fg[yellow]Pow restarting $1...$reset_color" | ||
fi | ||
} | ||
|
||
compctl -W ~/.pow -/ kapow |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# TODO: Make this compatible with rvm. | ||
# Run sudo gem on the system ruby, not the active ruby. | ||
alias sgem='sudo gem' | ||
|
||
# Find ruby file | ||
alias rfind='find . -name *.rb | xargs grep -n' | ||
alias rfind='find . -name *.rb | xargs grep -n' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,44 @@ | ||
fpath=($ZSH/plugins/rvm $fpath) | ||
autoload -U compinit | ||
compinit -i | ||
alias rubies='rvm list rubies' | ||
alias gemsets='rvm gemset list' | ||
|
||
local ruby18='ruby-1.8.7-p334' | ||
local ruby19='ruby-1.9.2-p180' | ||
|
||
function rb18 { | ||
if [ -z "$1" ]; then | ||
rvm use "$ruby18" | ||
else | ||
rvm use "$ruby18@$1" | ||
fi | ||
} | ||
|
||
_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`} | ||
compdef _rb18 rb18 | ||
|
||
function rb19 { | ||
if [ -z "$1" ]; then | ||
rvm use "$ruby19" | ||
else | ||
rvm use "$ruby19@$1" | ||
fi | ||
} | ||
|
||
_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} | ||
compdef _rb19 rb19 | ||
|
||
function rvm-update { | ||
rvm get head | ||
rvm reload # TODO: Reload rvm completion? | ||
} | ||
|
||
# TODO: Make this usable w/o rvm. | ||
function gems { | ||
local current_ruby=`rvm-prompt i v p` | ||
local current_gemset=`rvm-prompt g` | ||
|
||
gem list $@ | sed \ | ||
-Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ | ||
-Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ | ||
-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ | ||
-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#compdef thor | ||
#autoload | ||
|
||
compadd `thor list | grep thor | cut -d " " -f 2` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_CLEAN="" | ||
|
||
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch | ||
git_custom_status() { | ||
local cb=$(current_branch) | ||
if [ -n "$cb" ]; then | ||
echo "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" | ||
fi | ||
} | ||
|
||
|
||
PROMPT='%2~ $(git_custom_status) »%b ' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Name: trapd00r zsh theme | ||
# Author: Magnus Woldrich <m@japh.se> | ||
# | ||
# This theme needs a terminal supporting 256 colors as well as unicode. It also | ||
# needs the script that splits up the current path and makes it fancy as located | ||
# here: https://github.com/trapd00r/utils/blob/master/zsh_path | ||
# | ||
# By default it spans over two lines like so: | ||
# | ||
# scp1@shiva:pts/9-> /home » scp1 (0) | ||
# > | ||
# | ||
# that's user@host:pts/-> splitted path (return status) | ||
# | ||
# If the current directory is a git repository, we span 3 lines; | ||
# | ||
# git❨ master ❩ DIRTY | ||
# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0) | ||
# > | ||
|
||
autoload -U add-zsh-hook | ||
autoload -Uz vcs_info | ||
|
||
local c0=$( printf "\e[m") | ||
local c1=$( printf "\e[38;5;245m") | ||
local c2=$( printf "\e[38;5;250m") | ||
local c3=$( printf "\e[38;5;242m") | ||
local c4=$( printf "\e[38;5;197m") | ||
local c5=$( printf "\e[38;5;225m") | ||
local c6=$( printf "\e[38;5;240m") | ||
local c7=$( printf "\e[38;5;242m") | ||
local c8=$( printf "\e[38;5;244m") | ||
local c9=$( printf "\e[38;5;162m") | ||
local c10=$(printf "\e[1m") | ||
local c11=$(printf "\e[38;5;208m\e[1m") | ||
local c12=$(printf "\e[38;5;142m\e[1m") | ||
local c13=$(printf "\e[38;5;196m\e[1m") | ||
|
||
|
||
# We dont want to use the extended colorset in the TTY / VC. | ||
if [ "$TERM" = "linux" ]; then | ||
c1=$( printf "\e[34;1m") | ||
c2=$( printf "\e[35m") | ||
c3=$( printf "\e[31m") | ||
c4=$( printf "\e[31;1m") | ||
c5=$( printf "\e[32m") | ||
c6=$( printf "\e[32;1m") | ||
c7=$( printf "\e[33m") | ||
c8=$( printf "\e[33;1m") | ||
c9=$( printf "\e[34m") | ||
|
||
c11=$(printf "\e[35;1m") | ||
c12=$(printf "\e[36m") | ||
c13=$(printf "\e[31;1m") | ||
fi | ||
|
||
zstyle ':vcs_info:*' actionformats \ | ||
'%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' | ||
|
||
zstyle ':vcs_info:*' formats \ | ||
"%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f " | ||
|
||
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' | ||
zstyle ':vcs_info:*' enable git | ||
|
||
add-zsh-hook precmd prompt_jnrowe_precmd | ||
|
||
prompt_jnrowe_precmd () { | ||
vcs_info | ||
if [ "${vcs_info_msg_0_}" = "" ]; then | ||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" | ||
PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} | ||
> ' | ||
|
||
# modified, to be commited | ||
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then | ||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" | ||
PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} | ||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} | ||
> ' | ||
|
||
elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then | ||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" | ||
PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} | ||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} | ||
%{$c13%}>%{$c0%} ' | ||
else | ||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" | ||
PROMPT='${vcs_info_msg_0_} | ||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} | ||
> ' | ||
fi | ||
} | ||
|
||
# vim: set ft=zsh sw=2 et tw=0: |