Browse code

Merge remote branch 'origin/master' into restructure_plugins

Daniel Schauenberg authored on 01/10/2010 at 08:55:44
Showing 26 changed files
... ...
@@ -1,4 +1,4 @@
1
-## fixme - the load process here seems a bit bizarre
1
+# fixme - the load process here seems a bit bizarre
2 2
 
3 3
 unsetopt menu_complete   # do not autoselect the first completion entry
4 4
 unsetopt flowcontrol
... ...
@@ -30,6 +30,11 @@ zstyle ':completion:*:*:*:*:*' menu select
30 30
 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
31 31
 zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
32 32
 
33
+# disable named-directories autocompletion
34
+zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
35
+cdpath=(.)
36
+
37
+
33 38
 # Load known hosts file for auto-completion with ssh and scp commands
34 39
 if [ -f ~/.ssh/known_hosts ]; then
35 40
   zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
... ...
@@ -5,7 +5,7 @@ function title {
5 5
     print -nR $'\033k'$1$'\033'\\\
6 6
 
7 7
     print -nR $'\033]0;'$2$'\a'
8
-  elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
8
+  elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then
9 9
     # Use this one instead for XTerms:
10 10
     print -nR $'\033]0;'$*$'\a'
11 11
   fi
... ...
@@ -20,6 +20,7 @@ bindkey "^[[F"  end-of-line
20 20
 bindkey "^[[4~" end-of-line
21 21
 bindkey ' ' magic-space    # also do history expansion on space
22 22
 
23
+bindkey '^[[Z' reverse-menu-complete
23 24
 
24 25
 # consider emacs keybindings:
25 26
 
... ...
@@ -12,7 +12,7 @@ for config_file ($ZSH/custom/*.zsh) source $config_file
12 12
 
13 13
 # Load all of the plugins that were defined in ~/.zshrc
14 14
 plugin=${plugin:=()}
15
-for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh
15
+for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
16 16
 
17 17
 # Check for updates on initial load...
18 18
 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
... ...
@@ -21,5 +21,3 @@ then
21 21
 else
22 22
   /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
23 23
 fi
24
-
25
-unset config_file
26 24
\ No newline at end of file
27 25
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-# add brew completion function to path
2
-fpath=($ZSH/functions/brew $fpath)
3
-autoload -U compinit
4
-compinit -i
5 1
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add brew completion function to path
1
+fpath=($ZSH/functions/brew $fpath)
2
+autoload -U compinit
3
+compinit -i
0 4
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+#!/bin/zsh
1
+# 
2
+# Make the dirstack more persistant
3
+# 
4
+# Add dirpersist to $plugins in ~/.zshrc to load
5
+# 
6
+
7
+# $zdirstore is the file used to persist the stack
8
+zdirstore=~/.zdirstore
9
+
10
+dirpersistinstall () {
11
+    if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
12
+    else
13
+        if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
14
+            echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
15
+        else
16
+            echo "If you don't want this message to appear, remove dirspersist from \$plugins"
17
+        fi
18
+    fi
19
+}
20
+
21
+dirpersiststore () {
22
+    dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
23
+}
24
+
25
+dirpersistrestore () {
26
+    if [ -f $zdirstore ]; then
27
+        source $zdirstore
28
+    fi
29
+}
30
+
31
+DIRSTACKSIZE=10
32
+setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
33
+
34
+dirpersistinstall
35
+dirpersistrestore
36
+
37
+# Make popd changes permanent without having to wait for logout
38
+alias popd="popd;dirpersiststore"
0 39
deleted file mode 100644
... ...
@@ -1,32 +0,0 @@
1
-# Aliases
2
-alias g='git'
3
-alias gst='git status'
4
-alias gl='git pull'
5
-alias gup='git fetch && git rebase'
6
-alias gp='git push'
7
-alias gd='git diff | mate'
8
-alias gdv='git diff -w "$@" | vim -R -'
9
-alias gc='git commit -v'
10
-alias gca='git commit -v -a'
11
-alias gb='git branch'
12
-alias gba='git branch -a'
13
-alias gcount='git shortlog -sn'
14
-alias gcp='git cherry-pick'
15
-
16
-
17
-# Git and svn mix
18
-alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
19
-
20
-#
21
-# Will return the current branch name
22
-# Usage example: git pull origin $(current_branch)
23
-#
24
-function current_branch() {
25
-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
26
-  echo ${ref#refs/heads/}
27
-}
28
-
29
-# these aliases take advangate of the previous function
30
-alias ggpull='git pull origin $(current_branch)'
31
-alias ggpush='git push origin $(current_branch)'
32
-alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
33 1
\ No newline at end of file
34 2
new file mode 100644
... ...
@@ -0,0 +1,32 @@
0
+# Aliases
1
+alias g='git'
2
+alias gst='git status'
3
+alias gl='git pull'
4
+alias gup='git fetch && git rebase'
5
+alias gp='git push'
6
+alias gd='git diff | mate'
7
+alias gdv='git diff -w "$@" | vim -R -'
8
+alias gc='git commit -v'
9
+alias gca='git commit -v -a'
10
+alias gb='git branch'
11
+alias gba='git branch -a'
12
+alias gcount='git shortlog -sn'
13
+alias gcp='git cherry-pick'
14
+
15
+
16
+# Git and svn mix
17
+alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
18
+
19
+#
20
+# Will return the current branch name
21
+# Usage example: git pull origin $(current_branch)
22
+#
23
+function current_branch() {
24
+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
25
+  echo ${ref#refs/heads/}
26
+}
27
+
28
+# these aliases take advangate of the previous function
29
+alias ggpull='git pull origin $(current_branch)'
30
+alias ggpush='git push origin $(current_branch)'
31
+alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
0 32
\ No newline at end of file
1 33
deleted file mode 100644
... ...
@@ -1,16 +0,0 @@
1
-# To use: add a .lighthouse file into your directory with the URL to the
2
-# individual project. For example:
3
-# https://rails.lighthouseapp.com/projects/8994
4
-# Example usage: http://screencast.com/t/ZDgwNDUwNT
5
-open_lighthouse_ticket () {
6
-  if [ ! -f .lighthouse-url ]; then
7
-    echo "There is no .lighthouse file in the current directory..."
8
-    return 0;
9
-  else
10
-    lighthouse_url=$(cat .lighthouse-url);
11
-    echo "Opening ticket #$1";
12
-    `open $lighthouse_url/tickets/$1`;
13
-  fi
14
-}
15
-
16
-alias lho='open_lighthouse_ticket'
17 1
\ No newline at end of file
18 2
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+# To use: add a .lighthouse file into your directory with the URL to the
1
+# individual project. For example:
2
+# https://rails.lighthouseapp.com/projects/8994
3
+# Example usage: http://screencast.com/t/ZDgwNDUwNT
4
+open_lighthouse_ticket () {
5
+  if [ ! -f .lighthouse-url ]; then
6
+    echo "There is no .lighthouse file in the current directory..."
7
+    return 0;
8
+  else
9
+    lighthouse_url=$(cat .lighthouse-url);
10
+    echo "Opening ticket #$1";
11
+    `open $lighthouse_url/tickets/$1`;
12
+  fi
13
+}
14
+
15
+alias lho='open_lighthouse_ticket'
0 16
\ No newline at end of file
1 17
new file mode 100644
... ...
@@ -0,0 +1,7 @@
0
+#Aliases
1
+alias pc="sudo port clean --all installed"
2
+alias pi="sudo port install $1"
3
+alias psu="sudo port selfupdate"
4
+alias puni="sudo port uninstall inactive"
5
+alias puo="sudo port upgrade outdated"
6
+alias pup="psu && puo"
0 7
deleted file mode 100644
... ...
@@ -1,6 +0,0 @@
1
-# commands to control local mysql-server installation
2
-# paths are for osx installtion via macports
3
-
4
-alias mysqlstart='sudo /opt/local/bin/mysqld_safe5'
5
-alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
6
-alias mysqlstatus='mysqladmin5 -u root -p ping'
7 1
\ No newline at end of file
8 2
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+# commands to control local mysql-server installation
1
+# paths are for osx installtion via macports
2
+
3
+alias mysqlstart='sudo /opt/local/bin/mysqld_safe5'
4
+alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
5
+alias mysqlstatus='mysqladmin5 -u root -p ping'
0 6
\ No newline at end of file
1 7
deleted file mode 100644
... ...
@@ -1,11 +0,0 @@
1
-function tab() {
2
-  osascript 2>/dev/null <<EOF
3
-    tell application "System Events"
4
-      tell process "Terminal" to keystroke "t" using command down
5
-    end
6
-    tell application "Terminal"
7
-      activate
8
-      do script with command "cd \"$PWD\"; $*" in window 1
9
-    end tell
10
-EOF
11
-}
12 1
\ No newline at end of file
13 2
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+function tab() {
1
+  osascript 2>/dev/null <<EOF
2
+    tell application "System Events"
3
+      tell process "Terminal" to keystroke "t" using command down
4
+    end
5
+    tell application "Terminal"
6
+      activate
7
+      do script with command "cd \"$PWD\"; $*" in window 1
8
+    end tell
9
+EOF
10
+}
0 11
\ No newline at end of file
1 12
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-
2
-alias ss='thin --stats "/thin/stats" start'
3
-alias sg='ruby script/generate'
4
-alias sd='ruby script/destroy'
5
-alias sp='ruby script/plugin'
6
-alias ssp='ruby script/spec'
7
-alias rdbm='rake db:migrate'
8
-alias sc='ruby script/console'
9
-alias sd='ruby script/server --debugger'
10
-alias devlog='tail -f log/development.log'
11
-
12
-function _cap_does_task_list_need_generating () {
13
-  if [ ! -f .cap_tasks~ ]; then return 0;
14
-  else
15
-    accurate=$(stat -f%m .cap_tasks~)
16
-    changed=$(stat -f%m config/deploy.rb)
17
-    return $(expr $accurate '>=' $changed)
18
-  fi
19
-}
20
-
21
-function _cap () {
22
-  if [ -f config/deploy.rb ]; then
23
-    if _cap_does_task_list_need_generating; then
24
-      echo "\nGenerating .cap_tasks~..." > /dev/stderr
25
-      cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
26
-> .cap_tasks~
27
-    fi
28
-    compadd `cat .cap_tasks~`
29
-  fi
30
-}
31
-
32
-compctl -K _cap cap
33
-
34
-function remote_console() {
35
-  /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
36
-}
37 1
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+
1
+alias ss='thin --stats "/thin/stats" start'
2
+alias sg='ruby script/generate'
3
+alias sd='ruby script/destroy'
4
+alias sp='ruby script/plugin'
5
+alias ssp='ruby script/spec'
6
+alias rdbm='rake db:migrate'
7
+alias sc='ruby script/console'
8
+alias sd='ruby script/server --debugger'
9
+alias devlog='tail -f log/development.log'
10
+
11
+function _cap_does_task_list_need_generating () {
12
+  if [ ! -f .cap_tasks~ ]; then return 0;
13
+  else
14
+    accurate=$(stat -f%m .cap_tasks~)
15
+    changed=$(stat -f%m config/deploy.rb)
16
+    return $(expr $accurate '>=' $changed)
17
+  fi
18
+}
19
+
20
+function _cap () {
21
+  if [ -f config/deploy.rb ]; then
22
+    if _cap_does_task_list_need_generating; then
23
+      echo "\nGenerating .cap_tasks~..." > /dev/stderr
24
+      cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
25
+> .cap_tasks~
26
+    fi
27
+    compadd `cat .cap_tasks~`
28
+  fi
29
+}
30
+
31
+compctl -K _cap cap
32
+
33
+function remote_console() {
34
+  /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
35
+}
0 36
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-alias sgem='sudo gem'
2
-
3
-# Find ruby file
4
-alias rfind='find . -name *.rb | xargs grep -n'
5 1
\ No newline at end of file
6 2
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+alias sgem='sudo gem'
1
+
2
+# Find ruby file
3
+alias rfind='find . -name *.rb | xargs grep -n'
0 4
\ No newline at end of file
1 5
new file mode 100644
... ...
@@ -0,0 +1,23 @@
0
+# Based on code from Joseph M. Reagle
1
+# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
2
+
3
+local SSH_ENV=$HOME/.ssh/environment
4
+
5
+function start_agent {
6
+  /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
7
+  chmod 600 ${SSH_ENV}
8
+  . ${SSH_ENV} > /dev/null
9
+  /usr/bin/ssh-add;
10
+}
11
+
12
+# Source SSH settings, if applicable
13
+
14
+if [ -f "${SSH_ENV}" ]; then
15
+  . ${SSH_ENV} > /dev/null
16
+  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
17
+    start_agent;
18
+  }
19
+else
20
+  start_agent;
21
+fi
22
+
0 23
deleted file mode 100644
... ...
@@ -1,14 +0,0 @@
1
-
2
-# TextMate
3
-alias et='mate . &'
4
-alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
5
-alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
6
-alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
7
-
8
-# Editor Ruby file in TextMate
9
-alias mr='mate CHANGELOG app config db lib public script spec test'
10
-
11
-function tm() {
12
-  cd $1
13
-  mate $1
14
-}
15 1
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+
1
+# TextMate
2
+alias et='mate . &'
3
+alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
4
+alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
5
+alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
6
+
7
+# Editor Ruby file in TextMate
8
+alias mr='mate CHANGELOG app config db lib public script spec test'
9
+
10
+function tm() {
11
+  cd $1
12
+  mate $1
13
+}
0 14
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+function zle-line-init zle-keymap-select {
1
+  zle reset-prompt
2
+}
3
+
4
+zle -N zle-line-init
5
+zle -N zle-keymap-select
6
+
7
+bindkey -v
8
+
9
+# if mode indicator wasn't setup by theme, define default
10
+if [[ "$MODE_INDICATOR" == "" ]]; then
11
+  MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
12
+fi
13
+
14
+function vi_mode_prompt_info() {
15
+  echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
16
+}
17
+
18
+# define right prompt, if it wasn't defined by a theme
19
+if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
20
+  RPS1='$(vi_mode_prompt_info)'
21
+fi
0 22
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
1
+
2
+PROMPT='%{$fg[green]%}%c \
3
+$(git_prompt_info)\
4
+%{$fg[red]%}%(!.#.»)%{$reset_color%} '
5
+PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
6
+RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
7
+
8
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}("
9
+ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
10
+ZSH_THEME_GIT_PROMPT_CLEAN=""
11
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}"
12
+
0 13
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+# Comment 
1
+
2
+ZSH_THEME_GIT_PROMPT_PREFIX=' (git:'
3
+ZSH_THEME_GIT_PROMPT_SUFFIX=')'
4
+
5
+PROMPT='%{$fg[magenta]%}[%c]$(git_prompt_info) $ %{$reset_color%}'
0 6
\ No newline at end of file