From 7ccf4603a59bad1fa33c79a5276454d0a78e9656 Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Thu, 8 Sep 2011 10:48:39 +0200 Subject: [PATCH 1/7] files from dotfiles --- Rakefile | 3 ++ aliases.zsh | 34 ++++++++++++++++ completion.zsh | 8 ++++ config.zsh | 78 ++++++++++++++++++++++++++++++++++++ functions.zsh | 10 +++++ functions/_c | 2 + functions/_d | 2 + functions/c | 1 + functions/d | 1 + functions/verbose_completion | 5 +++ git_aliases | 54 +++++++++++++++++++++++++ zshrc | 46 +++++++++++++++++++++ 12 files changed, 244 insertions(+) create mode 100644 Rakefile create mode 100644 aliases.zsh create mode 100644 completion.zsh create mode 100644 config.zsh create mode 100644 functions.zsh create mode 100644 functions/_c create mode 100644 functions/_d create mode 100644 functions/c create mode 100644 functions/d create mode 100644 functions/verbose_completion create mode 100644 git_aliases create mode 100755 zshrc diff --git a/Rakefile b/Rakefile new file mode 100644 index 000000000..df364ad08 --- /dev/null +++ b/Rakefile @@ -0,0 +1,3 @@ +task :setup do + %x(ln -sf ~/.zsh/zshrc ~/.zshrc) +end \ No newline at end of file diff --git a/aliases.zsh b/aliases.zsh new file mode 100644 index 000000000..ca3cfb3b2 --- /dev/null +++ b/aliases.zsh @@ -0,0 +1,34 @@ +# ls +alias l="ls -FG" +alias ls="ls -FG" +alias la="l -lAh" + +alias e="$EDITOR" + +# git +alias g='git' +alias gl='git pull' +alias gp='git push' +alias gph='gp && gp heroku' +alias gd='git diff' +alias gc='git clone' +alias gco='git checkout' +alias gb='git branch' +alias gs='git status' +alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm" +alias gca='grm; git add .;gs;read;git commit' +alias git-authors='git shortlog -s -n' +# alias changelog='git log `git log -1 --format=%H -- CHANGELOG*`..; cat CHANGELOG*' +# alias gf='git flow' + +# rails +alias r="rails" +alias a='autotest -rails' +alias tlog='tail -f log/development.log' +alias rst='touch tmp/restart.txt' +alias bist="bundle install" + +# commands starting with % for pasting from web +alias %=' ' + +alias sleepmac="osascript -e 'tell application \"System Events\" to sleep'" diff --git a/completion.zsh b/completion.zsh new file mode 100644 index 000000000..4f22a94ef --- /dev/null +++ b/completion.zsh @@ -0,0 +1,8 @@ +autoload -U compinit +compinit + +# matches case insensitive for lowercase +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' + +# pasting with tabs doesn't perform completion +zstyle ':completion:*' insert-tab pending diff --git a/config.zsh b/config.zsh new file mode 100644 index 000000000..b4092cb13 --- /dev/null +++ b/config.zsh @@ -0,0 +1,78 @@ +# if [[ -n $SSH_CONNECTION ]]; then +# export PS1='%m:%3~$(git_info_for_prompt)%# ' +# else +# export PS1='%3~$(git_info_for_prompt)%# ' +# fi + +if (( ${+commands[mvim]} ));then + export EDITOR='mvim' +elif (( ${+commands[mate]} ));then + export EDITOR="mate" +else + export EDITOR='vim' +fi + +# uncommented since this is system dependent +# export PATH="$HOME/bin:$HOME/.bin:/usr/local/homebrew/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/git/bin:$PATH" +# export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" +# +# uncommented since this is system dependent (caused error on configure nginx on my server) +# export CC=gcc-4.2 + +# LANG is required by some programs, like ruby, so ensure that it is set (to UTF) +export LANG=en_US.UTF-8 + +if [[ -e /usr/libexec/java_home ]]; then + export JAVA_HOME="`/usr/libexec/java_home`" +fi + +fpath=(~/.zsh/functions $fpath) + +autoload -U ~/.zsh/functions/*(:t) + +#HISTFILE=~/.zsh_history +#HISTSIZE=1000 +#SAVEHIST=1000 +#REPORTTIME=10 # print elapsed time when more than 10 seconds + +#setopt NO_BG_NICE # don't nice background tasks +#setopt NO_HUP +#setopt NO_LIST_BEEP +#setopt LOCAL_OPTIONS # allow functions to have local options +#setopt LOCAL_TRAPS # allow functions to have local traps +#setopt HIST_VERIFY +## setopt SHARE_HISTORY # share history between sessions ??? +unsetopt EXTENDED_HISTORY # add timestamps to history +#setopt PROMPT_SUBST +#setopt CORRECT +#setopt COMPLETE_IN_WORD +#setopt IGNORE_EOF +#setopt AUTOCD # change to directory without "cd" + +#setopt APPEND_HISTORY # adds history +#setopt INC_APPEND_HISTORY # SHARE_HISTORY # adds history incrementally and share it across sessions +#setopt HIST_IGNORE_ALL_DUPS # don't record dupes in history +#setopt HIST_REDUCE_BLANKS + +#zle -N newtab + +#bindkey '^[^[[D' backward-word +#bindkey '^[^[[C' forward-word +#bindkey '^[[5D' beginning-of-line +#bindkey '^[[5C' end-of-line +#bindkey '^[[3~' delete-char +#bindkey '^[^N' newtab +#bindkey '^?' backward-delete-char +#bindkey '\e[3~' delete-char + +# reverse everything above and set it to default vim key-binding +#bindkey -e +## bindkey '' history-incremental-search-backward +#bindkey '' backward-word +#bindkey '' forward-word + +# ctrl-< and crtrl-> still works + +# rvm, should be at the end of this config file +[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. + diff --git a/functions.zsh b/functions.zsh new file mode 100644 index 000000000..387c516c8 --- /dev/null +++ b/functions.zsh @@ -0,0 +1,10 @@ +function title { + if [ "$TAB_TITLE" != "" ];then 1=$TAB_TITLE;fi + [ "$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) + fi +} diff --git a/functions/_c b/functions/_c new file mode 100644 index 000000000..24ca71afa --- /dev/null +++ b/functions/_c @@ -0,0 +1,2 @@ +#compdef c +_files -W ~/code -/ diff --git a/functions/_d b/functions/_d new file mode 100644 index 000000000..9246960c8 --- /dev/null +++ b/functions/_d @@ -0,0 +1,2 @@ +#compdef d +_files -W ~/Dropbox -/ diff --git a/functions/c b/functions/c new file mode 100644 index 000000000..89b6e1f68 --- /dev/null +++ b/functions/c @@ -0,0 +1 @@ +cd ~/code/$1; diff --git a/functions/d b/functions/d new file mode 100644 index 000000000..09b57cefe --- /dev/null +++ b/functions/d @@ -0,0 +1 @@ +cd ~/Dropbox/$1; diff --git a/functions/verbose_completion b/functions/verbose_completion new file mode 100644 index 000000000..8ea12248c --- /dev/null +++ b/functions/verbose_completion @@ -0,0 +1,5 @@ +zstyle ':completion:*' verbose yes +zstyle ':completion:*:descriptions' format '%B%d%b' +zstyle ':completion:*:messages' format '%d' +zstyle ':completion:*:warnings' format 'No matches for: %d' +zstyle ':completion:*' group-name '' diff --git a/git_aliases b/git_aliases new file mode 100644 index 000000000..d3afa6b2f --- /dev/null +++ b/git_aliases @@ -0,0 +1,54 @@ +export git_concise_log_format='--pretty=format:%Cblue%h%d%Creset %ar %Cgreen%an%Creset %s' + +git_current_branch() { + git symbolic-ref HEAD 2> /dev/null | sed -e 's/refs\/heads\///' +} + +alias ga='git add' +alias gap='ga -p' +alias gau='git add -u' +alias gbr='git branch -v' +gc() { + git diff --cached | grep '\btap[ph]\b' >/dev/null && + echo "\e[0;31;29mOops, there's a #tapp or similar in that diff.\e[0m" || + git commit -v "$@" +} +alias gc!='git commit -v' +alias gca='git commit -v -a' +alias gcam='gca --amend' +alias gch='git cherry-pick' +alias gcm='git commit -v --amend' +alias gco='git checkout' +alias gcop='gco -p' +alias gd='git diff -M' +alias gd.='git diff -M --color-words="."' +alias gdc='git diff --cached -M' +alias gdc.='git diff --cached -M --color-words="."' +alias gf='git fetch' +alias glog='git log $git_concise_log_format' +alias gl='glog --graph' +alias gla='gl --all' +alias gl_absolute='git log --pretty=format:"%Cblue%h%d%Creset %ad %Cgreen%an%Creset %s"' +gls() { + query="$1" + shift + glog --pickaxe-regex "-S$query" "$@" +} +alias gm='git merge --no-ff' +alias gmf='git merge --ff-only' +alias gp='git push' +alias gpt='gp --tags' +alias gr='git reset' +alias grb='git rebase -p' +alias grbc='git rebase --continue' +alias grbi='git rebase -i' +alias grh='git reset --hard' +alias grp='gr --patch' +alias grsh='git reset --soft HEAD~' +alias grv='git remote -v' +alias gs='git show' +alias gs.='git show --color-words="."' +alias gst='git stash' +alias gstp='git stash pop' +alias gup='git smart-pull' +alias graf='git remote add $argv[1] $argv[2] && gf $argv[1]' diff --git a/zshrc b/zshrc new file mode 100755 index 000000000..b02a21dd6 --- /dev/null +++ b/zshrc @@ -0,0 +1,46 @@ +# source global profile if exists. This is important, since in /etc/profile the /etc/profile.d/* files are sourced. +# These usually contain additional path variables and other global settings +[[ -f /etc/profile ]] && . /etc/profile + +# Path to your oh-my-zsh configuration. +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. +ZSH_THEME="robbyrussell" + +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" + +# Comment this out to disable weekly auto-update checks +# DISABLE_AUTO_UPDATE="true" + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# Uncomment following line if you want to disable autosetting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment following line if you want disable red dots displayed while waiting for completion +# DISABLE_COMPLETION_WAITING_DOTS="true" + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git rails ruby brew bundler cap gem github osx pow powder rails3 rvm vagrant) + +source $ZSH/oh-my-zsh.sh + +# Customize to your needs... +alias h="dirs -v" +unalias d + +RWZSH=$HOME/.zsh +. $RWZSH/config.zsh +. $RWZSH/aliases.zsh +. $RWZSH/completion.zsh +. $RWZSH/functions.zsh + +# use .localrc for settings specific to one system +[[ -f ~/.localrc ]] && . ~/.localrc From ffad1a76251b48fabe300232536ab4baab4524bd Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Tue, 13 Sep 2011 10:58:35 +0200 Subject: [PATCH 2/7] configuration and cool theme --- .gitignore | 1 + config.zsh | 1 + functions.zsh | 10 ---------- themes/rweng.zsh-theme | 15 +++++++++++++++ zshrc | 13 ++++++------- 5 files changed, 23 insertions(+), 17 deletions(-) delete mode 100644 functions.zsh create mode 100644 themes/rweng.zsh-theme diff --git a/.gitignore b/.gitignore index 2e8db7341..278852dbd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ custom/* !custom/example.zsh cache *.swp +.DS_Store \ No newline at end of file diff --git a/config.zsh b/config.zsh index b4092cb13..0c2bbb258 100644 --- a/config.zsh +++ b/config.zsh @@ -72,6 +72,7 @@ unsetopt EXTENDED_HISTORY # add timestamps to history #bindkey '' forward-word # ctrl-< and crtrl-> still works +export DISABLE_AUTO_UPDATE=true # rvm, should be at the end of this config file [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. diff --git a/functions.zsh b/functions.zsh deleted file mode 100644 index 387c516c8..000000000 --- a/functions.zsh +++ /dev/null @@ -1,10 +0,0 @@ -function title { - if [ "$TAB_TITLE" != "" ];then 1=$TAB_TITLE;fi - [ "$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) - fi -} diff --git a/themes/rweng.zsh-theme b/themes/rweng.zsh-theme new file mode 100644 index 000000000..cca6f33a3 --- /dev/null +++ b/themes/rweng.zsh-theme @@ -0,0 +1,15 @@ +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✘" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔" + +function prompt_char { + if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo "%{$fg[red]%}⚡"; fi +} + +PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} +) +%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) +%_$(prompt_char) ' + +RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/zshrc b/zshrc index b02a21dd6..26b57876e 100755 --- a/zshrc +++ b/zshrc @@ -3,19 +3,19 @@ [[ -f /etc/profile ]] && . /etc/profile # Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh +ZSH=$HOME/.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. -ZSH_THEME="robbyrussell" +ZSH_THEME="rweng" # Set to this to use case-sensitive completion # CASE_SENSITIVE="true" # Comment this out to disable weekly auto-update checks -# DISABLE_AUTO_UPDATE="true" +DISABLE_AUTO_UPDATE="true" # Uncomment following line if you want to disable colors in ls # DISABLE_LS_COLORS="true" @@ -37,10 +37,9 @@ alias h="dirs -v" unalias d RWZSH=$HOME/.zsh -. $RWZSH/config.zsh -. $RWZSH/aliases.zsh -. $RWZSH/completion.zsh -. $RWZSH/functions.zsh +. $ZSH/config.zsh +. $ZSH/aliases.zsh +. $ZSH/completion.zsh # use .localrc for settings specific to one system [[ -f ~/.localrc ]] && . ~/.localrc From 6d5041fca54c4761b27c9dec1efae06da342d815 Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Tue, 13 Sep 2011 10:59:26 +0200 Subject: [PATCH 3/7] username blue --- themes/rweng.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/rweng.zsh-theme b/themes/rweng.zsh-theme index cca6f33a3..314171801 100644 --- a/themes/rweng.zsh-theme +++ b/themes/rweng.zsh-theme @@ -9,7 +9,7 @@ function prompt_char { PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} ) -%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) +%{$fg[blue]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %_$(prompt_char) ' RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' From 3ec7dfb0e5ada870ee36b2fe061a02195bb95a1d Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Tue, 13 Sep 2011 17:10:15 +0200 Subject: [PATCH 4/7] modified my theme, make shell not return false --- themes/rweng.zsh-theme | 70 +++++++++++++++++++++++++++++++++++++----- zshrc | 4 ++- 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/themes/rweng.zsh-theme b/themes/rweng.zsh-theme index 314171801..3596054be 100644 --- a/themes/rweng.zsh-theme +++ b/themes/rweng.zsh-theme @@ -1,15 +1,71 @@ -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✘" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔" +# ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" +# ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}[" + +ZSH_THEME_GIT_PROMPT_PREFIX="" +ZSH_THEME_GIT_PROMPT_SUFFIX="]" # "]%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="*" +ZSH_THEME_GIT_PROMPT_CLEAN="" function prompt_char { if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo "%{$fg[red]%}⚡"; fi } -PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} +PROMPT='%(?, ,%{$fg[red]%}FAILED WITH CODE: $?%{$reset_color%} ) -%{$fg[blue]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) +%{$fg[blue]%}%~%{$reset_color%}$(git_time_since_commit)$(git_prompt_info) %_$(prompt_char) ' -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' +RPROMPT='%{$fg[blue]%}%n%{$reset_color%}@%{$fg[cyan]%}%m%{$reset_color%}' + + +# Colors vary depending on time lapsed. +ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" +ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" + +# Determine the time since last commit. If branch is clean, +# use a neutral color, otherwise colors will vary according to time. +function git_time_since_commit() { + if git rev-parse --git-dir > /dev/null 2>&1; then + # Only proceed if there is actually a commit. + if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then + # Get the last commit. + last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` + now=`date +%s` + seconds_since_last_commit=$((now-last_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 60 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" + elif [ "$MINUTES" -gt 30 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + fi + + if [ "$HOURS" -gt 24 ]; then + echo "${COLOR}[${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m|" + elif [ "$MINUTES" -gt 60 ]; then + echo "${COLOR}[${HOURS}h${SUB_MINUTES}m|" + else + echo "${COLOR}[${MINUTES}m|" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + echo "${COLOR}[~|" + fi + fi +} diff --git a/zshrc b/zshrc index 26b57876e..77bc5eb28 100755 --- a/zshrc +++ b/zshrc @@ -42,4 +42,6 @@ RWZSH=$HOME/.zsh . $ZSH/completion.zsh # use .localrc for settings specific to one system -[[ -f ~/.localrc ]] && . ~/.localrc +if [[ -f ~/.localrc ]]; then + . ~/.localrc +fi From 2aab2de99ad0ae18a18b212c710ac3f4de2b4093 Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Thu, 29 Sep 2011 17:03:01 +0200 Subject: [PATCH 5/7] use textmate as default editor, set IDEA_JDK --- aliases.zsh | 6 ++++-- config.zsh | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/aliases.zsh b/aliases.zsh index ca3cfb3b2..4e5e5d050 100644 --- a/aliases.zsh +++ b/aliases.zsh @@ -23,10 +23,12 @@ alias git-authors='git shortlog -s -n' # rails alias r="rails" -alias a='autotest -rails' alias tlog='tail -f log/development.log' alias rst='touch tmp/restart.txt' -alias bist="bundle install" +alias bi="bundle install" +alias bu="bundle update" +alias rake_db_migrate_both="rake db:migrate && rake db:migrate RAILS_ENV=test" + # commands starting with % for pasting from web alias %=' ' diff --git a/config.zsh b/config.zsh index 0c2bbb258..e355accb6 100644 --- a/config.zsh +++ b/config.zsh @@ -4,10 +4,10 @@ # export PS1='%3~$(git_info_for_prompt)%# ' # fi -if (( ${+commands[mvim]} ));then - export EDITOR='mvim' -elif (( ${+commands[mate]} ));then - export EDITOR="mate" +if (( ${+commands[mate]} ));then + export EDITOR='mate' +elif (( ${+commands[mvim]} ));then + export EDITOR="mvim" else export EDITOR='vim' fi @@ -26,6 +26,7 @@ if [[ -e /usr/libexec/java_home ]]; then export JAVA_HOME="`/usr/libexec/java_home`" fi +export IDEA_JDK="$JAVA_HOME" fpath=(~/.zsh/functions $fpath) autoload -U ~/.zsh/functions/*(:t) From 3c5fb0ad8890d0553774d94230ce4155df2f3bd8 Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Thu, 6 Oct 2011 22:42:02 +0200 Subject: [PATCH 6/7] update aliases --- aliases.zsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aliases.zsh b/aliases.zsh index 4e5e5d050..66c78243a 100644 --- a/aliases.zsh +++ b/aliases.zsh @@ -7,14 +7,12 @@ alias e="$EDITOR" # git alias g='git' -alias gl='git pull' alias gp='git push' -alias gph='gp && gp heroku' alias gd='git diff' alias gc='git clone' alias gco='git checkout' alias gb='git branch' -alias gs='git status' +alias gs='git status -sb' alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm" alias gca='grm; git add .;gs;read;git commit' alias git-authors='git shortlog -s -n' From c796d9f1d93931d15492d289b9ac54344315d3f3 Mon Sep 17 00:00:00 2001 From: Robin Wenglewski Date: Fri, 30 Dec 2011 03:35:03 +0100 Subject: [PATCH 7/7] remove rvm, dont source profile --- Rakefile | 1 + config.zsh | 4 ---- zshenv | 1 + zshrc | 3 ++- 4 files changed, 4 insertions(+), 5 deletions(-) create mode 100755 zshenv diff --git a/Rakefile b/Rakefile index df364ad08..df6411321 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,4 @@ task :setup do %x(ln -sf ~/.zsh/zshrc ~/.zshrc) + %x(ln -sf ~/.zsh/zshenv ~/.zshenv) end \ No newline at end of file diff --git a/config.zsh b/config.zsh index e355accb6..730ae3264 100644 --- a/config.zsh +++ b/config.zsh @@ -74,7 +74,3 @@ unsetopt EXTENDED_HISTORY # add timestamps to history # ctrl-< and crtrl-> still works export DISABLE_AUTO_UPDATE=true - -# rvm, should be at the end of this config file -[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. - diff --git a/zshenv b/zshenv new file mode 100755 index 000000000..73725a005 --- /dev/null +++ b/zshenv @@ -0,0 +1 @@ +eval "$(rbenv init -)" \ No newline at end of file diff --git a/zshrc b/zshrc index 77bc5eb28..9ee6b158a 100755 --- a/zshrc +++ b/zshrc @@ -1,6 +1,7 @@ # source global profile if exists. This is important, since in /etc/profile the /etc/profile.d/* files are sourced. # These usually contain additional path variables and other global settings -[[ -f /etc/profile ]] && . /etc/profile +# on the other hand, when I source this the path i set in zshenv seems to be overriden +# [[ -f /etc/profile ]] && . /etc/profile # Path to your oh-my-zsh configuration. ZSH=$HOME/.zsh