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
19 changed files
with
192 additions
and
34 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
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,17 +1,9 @@ | ||
#!/bin/zsh | ||
|
||
# Push and pop directories on directory stack | ||
alias pu='pushd' | ||
alias po='popd' | ||
|
||
alias ss='thin --stats "/thin/stats" start' | ||
alias devlog='tail -f log/development.log' | ||
|
||
# Super user | ||
alias _='sudo' | ||
|
||
# Show history | ||
alias history='fc -l 1' | ||
|
||
# TextMate | ||
alias et='mate . &' |
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 |
---|---|---|
|
@@ -44,13 +44,3 @@ function tab() { | |
end tell | ||
EOF | ||
} | ||
|
||
function take() { | ||
mkdir -p $1 | ||
cd $1 | ||
} | ||
|
||
function tm() { | ||
cd $1 | ||
mate $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
File renamed without changes.
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,32 @@ | ||
# Aliases | ||
alias g='git' | ||
alias gst='git status' | ||
alias gl='git pull' | ||
alias gup='git fetch && git rebase' | ||
alias gp='git push' | ||
alias gd='git diff | mate' | ||
alias gdv='git diff -w "$@" | vim -R -' | ||
alias gc='git commit -v' | ||
alias gca='git commit -v -a' | ||
alias gb='git branch' | ||
alias gba='git branch -a' | ||
alias gcount='git shortlog -sn' | ||
alias gcp='git cherry-pick' | ||
|
||
|
||
# Git and svn mix | ||
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' | ||
|
||
# | ||
# 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 advangate of the previous function | ||
alias ggpull='git pull origin $(current_branch)' | ||
alias ggpush='git push origin $(current_branch)' | ||
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' |
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,16 @@ | ||
# To use: add a .lighthouse file into your directory with the URL to the | ||
# individual project. For example: | ||
# https://rails.lighthouseapp.com/projects/8994 | ||
# Example usage: http://screencast.com/t/ZDgwNDUwNT | ||
open_lighthouse_ticket () { | ||
if [ ! -f .lighthouse-url ]; then | ||
echo "There is no .lighthouse file in the current directory..." | ||
return 0; | ||
else | ||
lighthouse_url=$(cat .lighthouse-url); | ||
echo "Opening ticket #$1"; | ||
`open $lighthouse_url/tickets/$1`; | ||
fi | ||
} | ||
|
||
alias lho='open_lighthouse_ticket' |
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,6 @@ | ||
# commands to control local mysql-server installation | ||
# paths are for osx installtion via macports | ||
|
||
alias mysqlstart='sudo /opt/local/bin/mysqld_safe5' | ||
alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown' | ||
alias mysqlstatus='mysqladmin5 -u root -p ping' |
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,11 @@ | ||
function tab() { | ||
osascript 2>/dev/null <<EOF | ||
tell application "System Events" | ||
tell process "Terminal" to keystroke "t" using command down | ||
end | ||
tell application "Terminal" | ||
activate | ||
do script with command "cd \"$PWD\"; $*" in window 1 | ||
end tell | ||
EOF | ||
} |
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,36 @@ | ||
|
||
alias ss='thin --stats "/thin/stats" start' | ||
alias sg='ruby script/generate' | ||
alias sd='ruby script/destroy' | ||
alias sp='ruby script/plugin' | ||
alias ssp='ruby script/spec' | ||
alias rdbm='rake db:migrate' | ||
alias sc='ruby script/console' | ||
alias sd='ruby script/server --debugger' | ||
alias devlog='tail -f log/development.log' | ||
|
||
function _cap_does_task_list_need_generating () { | ||
if [ ! -f .cap_tasks~ ]; then return 0; | ||
else | ||
accurate=$(stat -f%m .cap_tasks~) | ||
changed=$(stat -f%m config/deploy.rb) | ||
return $(expr $accurate '>=' $changed) | ||
fi | ||
} | ||
|
||
function _cap () { | ||
if [ -f config/deploy.rb ]; then | ||
if _cap_does_task_list_need_generating; then | ||
echo "\nGenerating .cap_tasks~..." > /dev/stderr | ||
cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' | ||
> .cap_tasks~ | ||
fi | ||
compadd `cat .cap_tasks~` | ||
fi | ||
} | ||
|
||
compctl -K _cap cap | ||
|
||
function remote_console() { | ||
/usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" | ||
} |
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 @@ | ||
alias sgem='sudo gem' | ||
|
||
# Find ruby file | ||
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
# TextMate | ||
alias et='mate . &' | ||
alias ett='mate app config lib db public spec test Rakefile Capfile Todo &' | ||
alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' | ||
alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' | ||
|
||
# Editor Ruby file in TextMate | ||
alias mr='mate CHANGELOG app config db lib public script spec test' | ||
|
||
function tm() { | ||
cd $1 | ||
mate $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,19 @@ | ||
#RVM settings | ||
if [[ -s ~/.rvm/scripts/rvm ]] ; then | ||
RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" | ||
fi | ||
|
||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" | ||
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 "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" | ||
fi | ||
} | ||
|
||
PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%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,27 @@ | ||
# | ||
# PROMPT | ||
# | ||
PROMPT_BRACKET_BEGIN='%{$fg_bold[white]%}[' | ||
PROMPT_HOST='%{$fg_bold[cyan]%}%m' | ||
PROMPT_SEPARATOR='%{$reset_color%}:' | ||
PROMPT_DIR='%{$fg_bold[yellow]%}%c' | ||
PROMPT_BRACKET_END='%{$fg_bold[white]%}]' | ||
|
||
PROMPT_USER='%{$fg_bold[white]%}%n' | ||
PROMPT_SIGN='%{$reset_color%}%#' | ||
|
||
GIT_PROMPT_INFO='$(git_prompt_info)' | ||
|
||
# My current prompt looks like: | ||
# [host:current_dir] (git_prompt_info) | ||
# [username]% | ||
PROMPT="${PROMPT_BRACKET_BEGIN}${PROMPT_HOST}${PROMPT_SEPARATOR}${PROMPT_DIR}${PROMPT_BRACKET_END}${GIT_PROMPT_INFO} | ||
${PROMPT_BRACKET_BEGIN}${PROMPT_USER}${PROMPT_BRACKET_END}${PROMPT_SIGN} " | ||
|
||
# | ||
# Git repository | ||
# | ||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" | ||
ZSH_THEME_GIT_PROMPT_CLEAN='' |
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,6 +1,12 @@ | ||
current_path=`pwd` | ||
echo "Upgrading Oh My Zsh" | ||
( cd $ZSH && git pull origin master ) | ||
echo ' __ __ ' | ||
echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' | ||
echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' | ||
echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' | ||
echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' | ||
echo ' /____/' | ||
echo "Hooray! Oh My Zsh has been updated and/or is at the current version. \nAny new updates will be reflected when you start your next terminal session." | ||
echo "To keep up on the latest, be sure to follow Oh My Zsh on twitter: http://twitter.com/ohmyzsh" | ||
cd $current_path |