From e37d62a282dc74b7cd265643dcb01f80e25b3e34 Mon Sep 17 00:00:00 2001 From: Tomas Kramar Date: Sun, 26 Sep 2010 16:05:53 +0200 Subject: unset config_file is useless --- oh-my-zsh.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index bb45c71eb..c46aea7ac 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -21,5 +21,3 @@ then else /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh fi - -unset config_file \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 26d97a9355d37c55e0b044d8dafc425cc0ca7217 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 30 Sep 2010 21:34:06 -0700 Subject: Reorganizing plugins so that each plugin has it's own directory now so that any plugin-specific functions can be bundled within there. --- oh-my-zsh.sh | 2 +- plugins/brew.plugin.zsh | 67 -------------------------------- plugins/brew/brew.plugin.zsh | 67 ++++++++++++++++++++++++++++++++ plugins/dirpersist.plugin.zsh | 39 ------------------- plugins/dirpersist/dirpersist.plugin.zsh | 39 +++++++++++++++++++ plugins/git.plugin.zsh | 32 --------------- plugins/git/git.plugin.zsh | 32 +++++++++++++++ plugins/lighthouse.plugin.zsh | 16 -------- plugins/lighthouse/lighthouse.plugin.zsh | 16 ++++++++ plugins/macports.plugin.zsh | 7 ---- plugins/macports/macports.plugin.zsh | 7 ++++ plugins/mysql-macports.plugin.zsh | 6 --- plugins/mysql/mysql-macports.plugin.zsh | 6 +++ plugins/osx.plugin.zsh | 11 ------ plugins/osx/osx.plugin.zsh | 11 ++++++ plugins/rails.plugin.zsh | 36 ----------------- plugins/rails/rails.plugin.zsh | 36 +++++++++++++++++ plugins/ruby.plugin.zsh | 4 -- plugins/ruby/ruby.plugin.zsh | 4 ++ plugins/ssh-agent.plugin.zsh | 23 ----------- plugins/ssh-agent/ssh-agent.plugin.zsh | 23 +++++++++++ plugins/textmate.plugin.zsh | 14 ------- plugins/textmate/textmate.plugin.zsh | 14 +++++++ plugins/vi-mode.plugin.zsh | 22 ----------- plugins/vi-mode/vi-mode.plugin.zsh | 22 +++++++++++ 25 files changed, 278 insertions(+), 278 deletions(-) delete mode 100644 plugins/brew.plugin.zsh create mode 100644 plugins/brew/brew.plugin.zsh delete mode 100644 plugins/dirpersist.plugin.zsh create mode 100644 plugins/dirpersist/dirpersist.plugin.zsh delete mode 100644 plugins/git.plugin.zsh create mode 100644 plugins/git/git.plugin.zsh delete mode 100644 plugins/lighthouse.plugin.zsh create mode 100644 plugins/lighthouse/lighthouse.plugin.zsh delete mode 100644 plugins/macports.plugin.zsh create mode 100644 plugins/macports/macports.plugin.zsh delete mode 100644 plugins/mysql-macports.plugin.zsh create mode 100644 plugins/mysql/mysql-macports.plugin.zsh delete mode 100644 plugins/osx.plugin.zsh create mode 100644 plugins/osx/osx.plugin.zsh delete mode 100644 plugins/rails.plugin.zsh create mode 100644 plugins/rails/rails.plugin.zsh delete mode 100644 plugins/ruby.plugin.zsh create mode 100644 plugins/ruby/ruby.plugin.zsh delete mode 100644 plugins/ssh-agent.plugin.zsh create mode 100644 plugins/ssh-agent/ssh-agent.plugin.zsh delete mode 100644 plugins/textmate.plugin.zsh create mode 100644 plugins/textmate/textmate.plugin.zsh delete mode 100644 plugins/vi-mode.plugin.zsh create mode 100644 plugins/vi-mode/vi-mode.plugin.zsh (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c46aea7ac..848e48eb5 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -12,7 +12,7 @@ for config_file ($ZSH/custom/*.zsh) source $config_file # Load all of the plugins that were defined in ~/.zshrc plugin=${plugin:=()} -for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh +for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" = "true" ] diff --git a/plugins/brew.plugin.zsh b/plugins/brew.plugin.zsh deleted file mode 100644 index 162eb6442..000000000 --- a/plugins/brew.plugin.zsh +++ /dev/null @@ -1,67 +0,0 @@ -#compdef brew - -# imported from the latest homebrew contributions - -_brew_all_formulae() { - formulae=(`brew search`) -} - -_brew_installed_formulae() { - installed_formulae=(`brew list`) -} - -local -a _1st_arguments -_1st_arguments=( - 'cat:display formula file for a formula' - 'cleanup:uninstall unused and old versions of packages' - 'create:create a new formula' - 'deps:list dependencies and dependants of a formula' - 'doctor:audits your installation for common issues' - 'edit:edit a formula' - 'home:visit the homepage of a formula or the brew project' - 'info:information about a formula' - 'install:install a formula' - 'link:link a formula' - 'list:list files in a formula or not-installed formulae' - 'log:git commit log for a formula' - 'outdated:list formulas for which a newer version is available' - 'prune:remove dead links' - 'remove:remove a formula' - 'search:search for a formula (/regex/ or string)' - 'unlink:unlink a formula' - 'update:freshen up links' - 'uses:show formulas which depend on a formula' -) - -local expl -local -a formula installed_formulae - -_arguments \ - '(-v --verbose)'{-v,--verbose}'[verbose]' \ - '(--version)--version[version information]' \ - '(--prefix)--prefix[where brew lives on this system]' \ - '(--cache)--cache[brew cache]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "brew subcommand" _1st_arguments - return -fi - -case "$words[1]" in - list) - _arguments \ - '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ - '1: :->forms' && return 0 - - if [[ "$state" == forms ]]; then - _brew_installed_formulae - _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae - fi ;; - install|home|log|info|uses|cat|deps) - _brew_all_formulae - _wanted formulae expl 'all formulae' compadd -a formulae ;; - remove|edit|xo) - _brew_installed_formulae - _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; -esac diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh new file mode 100644 index 000000000..162eb6442 --- /dev/null +++ b/plugins/brew/brew.plugin.zsh @@ -0,0 +1,67 @@ +#compdef brew + +# imported from the latest homebrew contributions + +_brew_all_formulae() { + formulae=(`brew search`) +} + +_brew_installed_formulae() { + installed_formulae=(`brew list`) +} + +local -a _1st_arguments +_1st_arguments=( + 'cat:display formula file for a formula' + 'cleanup:uninstall unused and old versions of packages' + 'create:create a new formula' + 'deps:list dependencies and dependants of a formula' + 'doctor:audits your installation for common issues' + 'edit:edit a formula' + 'home:visit the homepage of a formula or the brew project' + 'info:information about a formula' + 'install:install a formula' + 'link:link a formula' + 'list:list files in a formula or not-installed formulae' + 'log:git commit log for a formula' + 'outdated:list formulas for which a newer version is available' + 'prune:remove dead links' + 'remove:remove a formula' + 'search:search for a formula (/regex/ or string)' + 'unlink:unlink a formula' + 'update:freshen up links' + 'uses:show formulas which depend on a formula' +) + +local expl +local -a formula installed_formulae + +_arguments \ + '(-v --verbose)'{-v,--verbose}'[verbose]' \ + '(--version)--version[version information]' \ + '(--prefix)--prefix[where brew lives on this system]' \ + '(--cache)--cache[brew cache]' \ + '*:: :->subcmds' && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "brew subcommand" _1st_arguments + return +fi + +case "$words[1]" in + list) + _arguments \ + '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ + '1: :->forms' && return 0 + + if [[ "$state" == forms ]]; then + _brew_installed_formulae + _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae + fi ;; + install|home|log|info|uses|cat|deps) + _brew_all_formulae + _wanted formulae expl 'all formulae' compadd -a formulae ;; + remove|edit|xo) + _brew_installed_formulae + _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; +esac diff --git a/plugins/dirpersist.plugin.zsh b/plugins/dirpersist.plugin.zsh deleted file mode 100644 index 6a2b289a2..000000000 --- a/plugins/dirpersist.plugin.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/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 - -dirpersistinstall () { - if grep 'dirpersiststore' ~/.zlogout > /dev/null; then - else - if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then - echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout - else - echo "If you don't want this message to appear, remove dirspersist from \$plugins" - fi - fi -} - -dirpersiststore () { - dirs -p | perl -e 'foreach (reverse ) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore -} - -dirpersistrestore () { - if [ -f $zdirstore ]; then - source $zdirstore - fi -} - -DIRSTACKSIZE=10 -setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups - -dirpersistinstall -dirpersistrestore - -# Make popd changes permanent without having to wait for logout -alias popd="popd;dirpersiststore" diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh new file mode 100644 index 000000000..6a2b289a2 --- /dev/null +++ b/plugins/dirpersist/dirpersist.plugin.zsh @@ -0,0 +1,39 @@ +#!/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 + +dirpersistinstall () { + if grep 'dirpersiststore' ~/.zlogout > /dev/null; then + else + if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then + echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout + else + echo "If you don't want this message to appear, remove dirspersist from \$plugins" + fi + fi +} + +dirpersiststore () { + dirs -p | perl -e 'foreach (reverse ) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore +} + +dirpersistrestore () { + if [ -f $zdirstore ]; then + source $zdirstore + fi +} + +DIRSTACKSIZE=10 +setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups + +dirpersistinstall +dirpersistrestore + +# Make popd changes permanent without having to wait for logout +alias popd="popd;dirpersiststore" diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh deleted file mode 100644 index 655eaf728..000000000 --- a/plugins/git.plugin.zsh +++ /dev/null @@ -1,32 +0,0 @@ -# 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)' \ No newline at end of file diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh new file mode 100644 index 000000000..655eaf728 --- /dev/null +++ b/plugins/git/git.plugin.zsh @@ -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)' \ No newline at end of file diff --git a/plugins/lighthouse.plugin.zsh b/plugins/lighthouse.plugin.zsh deleted file mode 100644 index 4eb06a997..000000000 --- a/plugins/lighthouse.plugin.zsh +++ /dev/null @@ -1,16 +0,0 @@ -# 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' \ No newline at end of file diff --git a/plugins/lighthouse/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh new file mode 100644 index 000000000..4eb06a997 --- /dev/null +++ b/plugins/lighthouse/lighthouse.plugin.zsh @@ -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' \ No newline at end of file diff --git a/plugins/macports.plugin.zsh b/plugins/macports.plugin.zsh deleted file mode 100644 index 9564829b0..000000000 --- a/plugins/macports.plugin.zsh +++ /dev/null @@ -1,7 +0,0 @@ -#Aliases -alias pc="sudo port clean --all installed" -alias pi="sudo port install $1" -alias psu="sudo port selfupdate" -alias puni="sudo port uninstall inactive" -alias puo="sudo port upgrade outdated" -alias pup="psu && puo" diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh new file mode 100644 index 000000000..9564829b0 --- /dev/null +++ b/plugins/macports/macports.plugin.zsh @@ -0,0 +1,7 @@ +#Aliases +alias pc="sudo port clean --all installed" +alias pi="sudo port install $1" +alias psu="sudo port selfupdate" +alias puni="sudo port uninstall inactive" +alias puo="sudo port upgrade outdated" +alias pup="psu && puo" diff --git a/plugins/mysql-macports.plugin.zsh b/plugins/mysql-macports.plugin.zsh deleted file mode 100644 index 63b881c9f..000000000 --- a/plugins/mysql-macports.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# 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' \ No newline at end of file diff --git a/plugins/mysql/mysql-macports.plugin.zsh b/plugins/mysql/mysql-macports.plugin.zsh new file mode 100644 index 000000000..63b881c9f --- /dev/null +++ b/plugins/mysql/mysql-macports.plugin.zsh @@ -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' \ No newline at end of file diff --git a/plugins/osx.plugin.zsh b/plugins/osx.plugin.zsh deleted file mode 100644 index fce88c796..000000000 --- a/plugins/osx.plugin.zsh +++ /dev/null @@ -1,11 +0,0 @@ -function tab() { - osascript 2>/dev/null </dev/null <=' $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 )" -} diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh new file mode 100644 index 000000000..45bebb722 --- /dev/null +++ b/plugins/rails/rails.plugin.zsh @@ -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 )" +} diff --git a/plugins/ruby.plugin.zsh b/plugins/ruby.plugin.zsh deleted file mode 100644 index 82bf5d49d..000000000 --- a/plugins/ruby.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -alias sgem='sudo gem' - -# Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' \ No newline at end of file diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh new file mode 100644 index 000000000..82bf5d49d --- /dev/null +++ b/plugins/ruby/ruby.plugin.zsh @@ -0,0 +1,4 @@ +alias sgem='sudo gem' + +# Find ruby file +alias rfind='find . -name *.rb | xargs grep -n' \ No newline at end of file diff --git a/plugins/ssh-agent.plugin.zsh b/plugins/ssh-agent.plugin.zsh deleted file mode 100644 index ce0d645c1..000000000 --- a/plugins/ssh-agent.plugin.zsh +++ /dev/null @@ -1,23 +0,0 @@ -# Based on code from Joseph M. Reagle -# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html - -local SSH_ENV=$HOME/.ssh/environment - -function start_agent { - /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} - chmod 600 ${SSH_ENV} - . ${SSH_ENV} > /dev/null - /usr/bin/ssh-add; -} - -# Source SSH settings, if applicable - -if [ -f "${SSH_ENV}" ]; then - . ${SSH_ENV} > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { - start_agent; - } -else - start_agent; -fi - diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh new file mode 100644 index 000000000..ce0d645c1 --- /dev/null +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -0,0 +1,23 @@ +# Based on code from Joseph M. Reagle +# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html + +local SSH_ENV=$HOME/.ssh/environment + +function start_agent { + /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} + chmod 600 ${SSH_ENV} + . ${SSH_ENV} > /dev/null + /usr/bin/ssh-add; +} + +# Source SSH settings, if applicable + +if [ -f "${SSH_ENV}" ]; then + . ${SSH_ENV} > /dev/null + ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { + start_agent; + } +else + start_agent; +fi + diff --git a/plugins/textmate.plugin.zsh b/plugins/textmate.plugin.zsh deleted file mode 100644 index 7b73e2751..000000000 --- a/plugins/textmate.plugin.zsh +++ /dev/null @@ -1,14 +0,0 @@ - -# 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 -} diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh new file mode 100644 index 000000000..7b73e2751 --- /dev/null +++ b/plugins/textmate/textmate.plugin.zsh @@ -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 +} diff --git a/plugins/vi-mode.plugin.zsh b/plugins/vi-mode.plugin.zsh deleted file mode 100644 index c47ab7211..000000000 --- a/plugins/vi-mode.plugin.zsh +++ /dev/null @@ -1,22 +0,0 @@ -function zle-line-init zle-keymap-select { - zle reset-prompt -} - -zle -N zle-line-init -zle -N zle-keymap-select - -bindkey -v - -# if mode indicator wasn't setup by theme, define default -if [[ "$MODE_INDICATOR" == "" ]]; then - MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" -fi - -function vi_mode_prompt_info() { - echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" -} - -# define right prompt, if it wasn't defined by a theme -if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then - RPS1='$(vi_mode_prompt_info)' -fi diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh new file mode 100644 index 000000000..c47ab7211 --- /dev/null +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -0,0 +1,22 @@ +function zle-line-init zle-keymap-select { + zle reset-prompt +} + +zle -N zle-line-init +zle -N zle-keymap-select + +bindkey -v + +# if mode indicator wasn't setup by theme, define default +if [[ "$MODE_INDICATOR" == "" ]]; then + MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" +fi + +function vi_mode_prompt_info() { + echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" +} + +# define right prompt, if it wasn't defined by a theme +if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then + RPS1='$(vi_mode_prompt_info)' +fi -- cgit v1.2.3-70-g09d2