Cleaned up /lib/, removed trailing white space everywhere.

This commit is contained in:
Sorin Ionescu 2011-06-01 02:48:26 -04:00
commit 1e9b718af1
50 changed files with 332 additions and 298 deletions

View file

@ -7,7 +7,7 @@
if (( ${+commands[compleat]} )); then
local prefix="${commands[compleat]:h:h}"
local setup="${prefix}/share/compleat-1.0/compleat_setup"
local setup="${prefix}/share/compleat-1.0/compleat_setup"
if [[ -f "$setup" ]]; then
if ! bashcompinit >/dev/null 2>&1; then
@ -15,6 +15,6 @@ if (( ${+commands[compleat]} )); then
bashcompinit -i
fi
source "$setup"
source "$setup"
fi
fi

View file

@ -1,9 +1,9 @@
#!/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

View file

@ -23,7 +23,7 @@ function extract() {
remove_archive=1
if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
remove_archive=0
remove_archive=0
shift
fi
@ -64,10 +64,10 @@ function extract() {
cd ..; rm *.tar.gz debian-binary
cd ..
;;
(*)
(*)
echo "extract: '$1' cannot be extracted" 1>&2
success=1
;;
success=1
;;
esac
(( success = $success > 0 ? $success : $? ))

View file

@ -329,4 +329,4 @@ __git_command_successful () {
return 0
}
zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'

View file

@ -1,4 +1,3 @@
# Aliases
alias g='git'
compdef g=git
alias gst='git status'
@ -27,24 +26,12 @@ alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
alias glg='git log --stat --max-count=5'
compdef _git glg=git-log
# Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
compdef git-svn-dcommit-push=git
#
# 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 advantage of the previous function
alias ggpull='git pull origin $(current_branch)'
alias ggpull='git pull origin $(git_current_branch)'
compdef ggpull=git
alias ggpush='git push origin $(current_branch)'
alias ggpush='git push origin $(git_current_branch)'
compdef ggpush=git
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
alias ggpnp='git pull origin $(git_current_branch) && git push origin $(git_current_branch)'
compdef ggpnp=git

View file

@ -6,7 +6,7 @@
# ------------------------------------------------------------------------------
if [[ -x "${commands[gwhoami]}" ]]; then
if [[ -x "${commands[gwhoami]}" ]]; then
__gnu_utils() {
emulate -L zsh
local gcmds
@ -14,7 +14,7 @@ if [[ -x "${commands[gwhoami]}" ]]; then
local cmd
local prefix
# coreutils
# coreutils
gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod'
'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
@ -35,7 +35,7 @@ if [[ -x "${commands[gwhoami]}" ]]; then
for gcmd in "${gcmds[@]}"; do
#
# This method allows for builtin commands to be primary but it's
# lost if hash -r or rehash -f is executed. Thus, those two
# lost if hash -r or rehash -f is executed. Thus, those two
# functions have to be wrapped.
#
(( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]}

View file

@ -1,6 +1,6 @@
#compdef port
local subcmds
local subcmds
# we cache the list of ports
# we shall use some cache policy to avoid problems with new ports
@ -31,8 +31,8 @@ subcmds=(
'file'
'help'
'info'
'install'
'installed'
'install'
'installed'
'list'
'livecheck'
'location'
@ -48,7 +48,7 @@ subcmds=(
'test'
'unarchive'
'uninstall'
'upgrade'
'upgrade'
'variants'
'version'
)

View file

@ -44,7 +44,7 @@ EOF
}
function pfd() {
osascript 2>/dev/null <<EOF
osascript 2>/dev/null <<EOF
tell application "Finder"
return POSIX path of (target of window 1 as alias)
end tell
@ -52,14 +52,14 @@ EOF
}
function pfs() {
osascript 2>/dev/null <<EOF
osascript 2>/dev/null <<EOF
set output to ""
tell application "Finder" to set the_selection to selection
set item_count to count the_selection
repeat with item_index from 1 to count the_selection
if item_index is less than item_count then set the_delimiter to "\n"
if item_index is item_count then set the_delimiter to ""
set output to output & ((item item_index of the_selection as alias)'s POSIX path) & the_delimiter
set output to output & ((item item_index of the_selection as alias)'s POSIX path) & the_delimiter
end repeat
EOF
}

View file

@ -27,7 +27,7 @@ alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/pe
# Functions #################################################################
# newpl - creates a basic Perl script file and opens it with $EDITOR
# newpl - creates a basic Perl script file and opens it with $EDITOR
newpl () {
# set $EDITOR to 'vim' if it is undefined
[[ -z $EDITOR ]] && EDITOR=vim

View file

@ -139,4 +139,4 @@ _arguments \
if (( CURRENT == 1 )); then
_describe -t commands "redis-cli subcommand" _1st_arguments
return
fi
fi

View file

@ -34,7 +34,7 @@ _arguments -C \
case $state in
cmds)
cmds=(
cmds=(
"version:show the rvm version installed in rvm_path"
"use:setup current shell to use a specific ruby version"
"reload:reload rvm source itself (useful after changing rvm source)"
@ -116,7 +116,7 @@ case $state in
if (( CURRENT == 3 )); then
_values 'package_commands' \
'install' \
'uninstall'
'uninstall'
else
_values 'packages' \
'readline' \

View file

@ -15,7 +15,7 @@ function in_svn() {
function svn_get_repo_name {
if [ is_svn ]; then
svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//"
fi
}
@ -29,9 +29,9 @@ function svn_get_rev_nr {
function svn_dirty_choose {
if [ is_svn ]; then
s=$(svn status 2>/dev/null)
if [ $s ]; then
if [ $s ]; then
echo $1
else
else
echo $2
fi
fi
@ -39,4 +39,4 @@ function svn_dirty_choose {
function svn_dirty {
svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
}
}

View file

@ -1,4 +1,4 @@
#compdef vagrant
#compdef vagrant
#autoload
# vagrant zsh completion
@ -64,7 +64,7 @@ __vagrant-box ()
(options)
case $line[1] in
(repackage|remove)
_arguments ':feature:__box_list'
_arguments ':feature:__box_list'
;;
esac
;;
@ -93,7 +93,7 @@ case $state in
(options)
case $line[1] in
(help)
_arguments ':feature:__task_list'
_arguments ':feature:__task_list'
;;
(box)

View file

@ -52,7 +52,7 @@ bindkey -v # Use vi key bindings.
bindkey -M vicmd "^M" accept_line # Alow RETURN in vi command.
bindkey -M vicmd v edit-command-line # ESC-v to edit in an external editor.
bindkey ' ' magic-space
bindkey ' ' magic-space
bindkey -M vicmd "gg" beginning-of-history
bindkey -M vicmd "G" end-of-history