This commit is contained in:
hc 2015-11-21 03:07:43 +00:00
commit 6aa700e5dc
262 changed files with 194 additions and 2 deletions

0
plugins/ant/ant.plugin.zsh Normal file → Executable file
View file

0
plugins/apache2-macports/apache2-macports.plugin.zsh Normal file → Executable file
View file

0
plugins/archlinux/archlinux.plugin.zsh Normal file → Executable file
View file

0
plugins/autojump/autojump.plugin.zsh Normal file → Executable file
View file

0
plugins/battery/battery.plugin.zsh Normal file → Executable file
View file

0
plugins/brew/_brew Normal file → Executable file
View file

0
plugins/brew/brew.plugin.zsh Normal file → Executable file
View file

0
plugins/bundler/_bundler Normal file → Executable file
View file

0
plugins/bundler/bundler.plugin.zsh Normal file → Executable file
View file

0
plugins/bwana/bwana.plugin.zsh Normal file → Executable file
View file

0
plugins/cake/cake.plugin.zsh Normal file → Executable file
View file

0
plugins/capistrano/_capistrano Normal file → Executable file
View file

0
plugins/cloudapp/cloudapp.plugin.zsh Normal file → Executable file
View file

0
plugins/coffee/_coffee Normal file → Executable file
View file

0
plugins/colemak/colemak-less Normal file → Executable file
View file

0
plugins/colemak/colemak.plugin.zsh Normal file → Executable file
View file

0
plugins/command-not-found/command-not-found.plugin.zsh Normal file → Executable file
View file

0
plugins/compleat/compleat.plugin.zsh Normal file → Executable file
View file

0
plugins/composer/composer.plugin.zsh Normal file → Executable file
View file

0
plugins/cp/cp.plugin.zsh Normal file → Executable file
View file

0
plugins/cpanm/_cpanm Normal file → Executable file
View file

0
plugins/debian/debian.plugin.zsh Normal file → Executable file
View file

0
plugins/dircycle/dircycle.plugin.zsh Normal file → Executable file
View file

0
plugins/dirpersist/dirpersist.plugin.zsh Normal file → Executable file
View file

0
plugins/django/django.plugin.zsh Normal file → Executable file
View file

0
plugins/encode64/encode64.plugin.zsh Normal file → Executable file
View file

0
plugins/extract/_extract Normal file → Executable file
View file

0
plugins/extract/extract.plugin.zsh Normal file → Executable file
View file

0
plugins/fasd/fasd.plugin.zsh Normal file → Executable file
View file

0
plugins/forklift/forklift.plugin.zsh Normal file → Executable file
View file

0
plugins/gas/_gas Normal file → Executable file
View file

0
plugins/gem/_gem Normal file → Executable file
View file

0
plugins/git-extras/git-extras.plugin.zsh Normal file → Executable file
View file

0
plugins/git-flow/git-flow.plugin.zsh Normal file → Executable file
View file

0
plugins/git-hubflow/git-hubflow.plugin.zsh Normal file → Executable file
View file

0
plugins/git-remote-branch/git-remote-branch.plugin.zsh Normal file → Executable file
View file

0
plugins/git/git.plugin.zsh Normal file → Executable file
View file

0
plugins/gitfast/_git Normal file → Executable file
View file

0
plugins/gitfast/git-completion.bash Normal file → Executable file
View file

0
plugins/gitfast/git-prompt.sh Normal file → Executable file
View file

0
plugins/gitfast/gitfast.plugin.zsh Normal file → Executable file
View file

0
plugins/github/_github Normal file → Executable file
View file

0
plugins/github/github.plugin.zsh Normal file → Executable file
View file

0
plugins/gnu-utils/gnu-utils.plugin.zsh Normal file → Executable file
View file

0
plugins/gpg-agent/gpg-agent.plugin.zsh Normal file → Executable file
View file

0
plugins/gradle/gradle.plugin.zsh Normal file → Executable file
View file

0
plugins/heroku/_heroku Normal file → Executable file
View file

View file

View file

0
plugins/history/history.plugin.zsh Normal file → Executable file
View file

0
plugins/jake-node/jake-node.plugin.zsh Normal file → Executable file
View file

0
plugins/jira/jira.plugin.zsh Normal file → Executable file
View file

0
plugins/kate/kate.plugin.zsh Normal file → Executable file
View file

0
plugins/knife/_knife Normal file → Executable file
View file

0
plugins/laravel/_artisan Normal file → Executable file
View file

0
plugins/laravel/laravel.plugin.zsh Normal file → Executable file
View file

0
plugins/last-working-dir/last-working-dir.plugin.zsh Normal file → Executable file
View file

0
plugins/lein/lein.plugin.zsh Normal file → Executable file
View file

0
plugins/lighthouse/lighthouse.plugin.zsh Normal file → Executable file
View file

0
plugins/lol/lol.plugin.zsh Normal file → Executable file
View file

0
plugins/macports/_port Normal file → Executable file
View file

0
plugins/macports/macports.plugin.zsh Normal file → Executable file
View file

0
plugins/mercurial/mercurial.plugin.zsh Normal file → Executable file
View file

0
plugins/mvn/mvn.plugin.zsh Normal file → Executable file
View file

0
plugins/mysql-macports/mysql-macports.plugin.zsh Normal file → Executable file
View file

0
plugins/nanoc/_nanoc Normal file → Executable file
View file

0
plugins/nanoc/nanoc.plugin.zsh Normal file → Executable file
View file

0
plugins/node/node.plugin.zsh Normal file → Executable file
View file

0
plugins/npm/npm.plugin.zsh Normal file → Executable file
View file

0
plugins/nyan/nyan.plugin.zsh Normal file → Executable file
View file

0
plugins/osx/_man-preview Normal file → Executable file
View file

0
plugins/osx/osx.plugin.zsh Normal file → Executable file
View file

0
plugins/pass/_pass Normal file → Executable file
View file

View file

@ -1 +0,0 @@
per-directory-history.zsh

View file

@ -0,0 +1,149 @@
#!/usr/bin/env zsh
#
# This is a implementation of per directory history for zsh, some
# implementations of which exist in bash[1,2]. It also implements
# a per-directory-history-toggle-history function to change from using the
# directory history to using the global history. In both cases the history is
# always saved to both the global history and the directory history, so the
# toggle state will not effect the saved histories. Being able to switch
# between global and directory histories on the fly is a novel feature as far
# as I am aware.
#
#-------------------------------------------------------------------------------
# Configuration
#-------------------------------------------------------------------------------
#
# HISTORY_BASE a global variable that defines the base directory in which the
# directory histories are stored
#
#-------------------------------------------------------------------------------
# History
#-------------------------------------------------------------------------------
#
# The idea/inspiration for a per directory history is from Stewart MacArthur[1]
# and Dieter[2], the implementation idea is from Bart Schaefer on the the zsh
# mailing list[3]. The implementation is by Jim Hester in September 2012.
#
# [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
# [2]: http://dieter.plaetinck.be/per_directory_bash
# [3]: http://www.zsh.org/mla/users/1997/msg00226.html
#
################################################################################
#
# Copyright (c) 2012 Jim Hester
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from the
# use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not claim
# that you wrote the original software. If you use this software in a product,
# an acknowledgment in the product documentation would be appreciated but is
# not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution..
#
################################################################################
#-------------------------------------------------------------------------------
# configuration, the base under which the directory histories are stored
#-------------------------------------------------------------------------------
[[ -z $HISTORY_BASE ]] && HISTORY_BASE="$HOME/.directory_history"
#-------------------------------------------------------------------------------
# toggle global/directory history used for searching - ctrl-G by default
#-------------------------------------------------------------------------------
function per-directory-history-toggle-history() {
if [[ $_per_directory_history_is_global == true ]]; then
_per-directory-history-set-directory-history
print "\nusing local history\n"
else
_per-directory-history-set-global-history
print "\nusing global history\n"
fi
zle .push-line
zle .accept-line
}
autoload per-directory-history-toggle-history
zle -N per-directory-history-toggle-history
bindkey '^G' per-directory-history-toggle-history
#-------------------------------------------------------------------------------
# implementation details
#-------------------------------------------------------------------------------
_per_directory_history_directory="$HISTORY_BASE${PWD:A}/history"
function _per-directory-history-change-directory() {
_per_directory_history_directory="$HISTORY_BASE${PWD:A}/history"
mkdir -p ${_per_directory_history_directory:h}
if [[ $_per_directory_history_is_global == false ]]; then
#save to the global history
fc -AI $HISTFILE
#save history to previous file
local prev="$HISTORY_BASE${OLDPWD:A}/history"
mkdir -p ${prev:h}
fc -AI $prev
#discard previous directory's history
local original_histsize=$HISTSIZE
HISTSIZE=0
HISTSIZE=$original_histsize
#read history in new file
if [[ -e $_per_directory_history_directory ]]; then
fc -R $_per_directory_history_directory
fi
fi
}
function _per-directory-history-addhistory() {
print -sr -- ${1%%$'\n'}
fc -p $_per_directory_history_directory
}
function _per-directory-history-set-directory-history() {
if [[ $_per_directory_history_is_global == true ]]; then
fc -AI $HISTFILE
local original_histsize=$HISTSIZE
HISTSIZE=0
HISTSIZE=$original_histsize
if [[ -e "$_per_directory_history_directory" ]]; then
fc -R "$_per_directory_history_directory"
fi
fi
_per_directory_history_is_global=false
}
function _per-directory-history-set-global-history() {
if [[ $_per_directory_history_is_global == false ]]; then
fc -AI $_per_directory_history_directory
local original_histsize=$HISTSIZE
HISTSIZE=0
HISTSIZE=$original_histsize
if [[ -e "$HISTFILE" ]]; then
fc -R "$HISTFILE"
fi
fi
_per_directory_history_is_global=true
}
#add functions to the exec list for chpwd and zshaddhistory
chpwd_functions=(${chpwd_functions[@]} "_per-directory-history-change-directory")
zshaddhistory_functions=(${zshaddhistory_functions[@]} "_per-directory-history-addhistory")
#start in directory mode
mkdir -p ${_per_directory_history_directory:h}
_per_directory_history_is_global=true
_per-directory-history-set-directory-history

0
plugins/perl/perl.plugin.zsh Normal file → Executable file
View file

0
plugins/phing/phing.plugin.zsh Normal file → Executable file
View file

0
plugins/pip/_pip Normal file → Executable file
View file

0
plugins/pow/pow.plugin.zsh Normal file → Executable file
View file

0
plugins/powder/_powder Normal file → Executable file
View file

0
plugins/python/python.plugin.zsh Normal file → Executable file
View file

0
plugins/rails/rails.plugin.zsh Normal file → Executable file
View file

0
plugins/rake/rake.plugin.zsh Normal file → Executable file
View file

0
plugins/rbenv/rbenv.plugin.zsh Normal file → Executable file
View file

0
plugins/rbfu/rbfu.plugin.zsh Normal file → Executable file
View file

0
plugins/redis-cli/_redis-cli Normal file → Executable file
View file

0
plugins/rsync/rsync.plugin.zsh Normal file → Executable file
View file

0
plugins/ruby/ruby.plugin.zsh Normal file → Executable file
View file

0
plugins/rvm/rvm.plugin.zsh Normal file → Executable file
View file

0
plugins/screen/screen.plugin.zsh Normal file → Executable file
View file

0
plugins/sprunge/sprunge.plugin.zsh Normal file → Executable file
View file

0
plugins/ssh-agent/ssh-agent.plugin.zsh Normal file → Executable file
View file

0
plugins/supervisor/_supervisorctl Normal file → Executable file
View file

0
plugins/supervisor/_supervisord Normal file → Executable file
View file

0
plugins/supervisor/supervisor.plugin.zsh Normal file → Executable file
View file

0
plugins/suse/suse.plugin.zsh Normal file → Executable file
View file

46
plugins/svn/svn.plugin.zsh Normal file → Executable file
View file

@ -1,3 +1,21 @@
<<<<<<< HEAD
SVN_DIRTY_COUNT="svn_dirty_count_string_wait_for_replacement"
function svn_prompt_info {
if [ $(in_svn) ]; then
if [ "x$SVN_SHOW_NONE" != "x1" ]; then
if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then
unset SVN_SHOW_BRANCH
_DISPLAY=$(svn_get_branch_name)
else
_DISPLAY=$(svn_get_repo_name)
fi
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
unset _DISPLAY
else
echo "$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
fi
=======
# vim:ft=zsh ts=2 sw=2 sts=2
#
function svn_prompt_info() {
@ -9,18 +27,26 @@ function svn_prompt_info() {
else
_DISPLAY=$(svn_get_repo_name)
_DISPLAY=$(omz_urldecode "${_DISPLAY}")
>>>>>>> upstream/master
fi
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$(svn_dirty_pwd)$ZSH_PROMPT_BASE_COLOR"
fi
}
function in_svn() {
<<<<<<< HEAD
is_svn=0
svn status 2>&1 1>/dev/null | grep -c '.*' | read is_svn
if [ "x$is_svn" = "x0" ]; then
echo 1
fi
=======
if $(svn info >/dev/null 2>&1); then
return 0
fi
return 1
>>>>>>> upstream/master
}
function svn_get_repo_name() {
@ -75,6 +101,23 @@ function svn_dirty() {
svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
}
<<<<<<< HEAD
function svn_dirty_choose {
if [ $(in_svn) ]; then
if [ "x$ZSH_THEME_SVN_NUVC_IN_DIRTY" = "x0" ]; then
svn status 2> /dev/null | grep -Ec '^\s*[ACDIM!L]' | read DIRTY_COUNT
else
svn status 2> /dev/null | grep -Ec '^\s*[ACDIM!?L]' | read DIRTY_COUNT
fi
if [ "x$DIRTY_COUNT" != "x0" ]; then
# Grep exits with 0 when "One or more lines were selected", return "dirty".
echo -e $1 | sed -e "s/${SVN_DIRTY_COUNT}/${DIRTY_COUNT}/g" | read output
echo $output
else
# Otherwise, no lines were found, or an error occurred. Return clean.
echo $2
fi
=======
function svn_dirty_choose_pwd () {
if in_svn; then
local root=$PWD
@ -84,6 +127,7 @@ function svn_dirty_choose_pwd () {
else
# Otherwise, no lines were found, or an error occurred. Return clean.
echo $2
>>>>>>> upstream/master
fi
fi
}

0
plugins/symfony/symfony.plugin.zsh Normal file → Executable file
View file

0
plugins/symfony2/symfony2.plugin.zsh Normal file → Executable file
View file

0
plugins/systemd/systemd.plugin.zsh Normal file → Executable file
View file

Some files were not shown because too many files have changed in this diff Show more