Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! I cleaned up your code for you! #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/directories.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ alias rd=rmdir
alias d='dirs -v'

# mkdir & cd to it
function mcd() {
mkdir -p "$1" && cd "$1";
function mcd() {
mkdir -p "$1" && cd "$1";
}
2 changes: 1 addition & 1 deletion lib/termsupport.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#Limited support for Apple Terminal (Terminal can't set window or tab separately)
function title {
[ "$DISABLE_AUTO_TITLE" != "true" ] || return
if [[ "$TERM" == screen* ]]; then
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
Expand Down
4 changes: 2 additions & 2 deletions plugins/archlinux/archlinux.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [[ -x `which yaourt` ]]; then
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
alias yain='yaourt -S' # Install specific package(s) from the repositories
alias yains='yaourt -U' # Install specific package not from the repositories but from a file
alias yains='yaourt -U' # Install specific package not from the repositories but from a file
alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
alias yarep='yaourt -Si' # Display information about a given package in the repositories
Expand All @@ -34,7 +34,7 @@ fi
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
alias pacin='sudo pacman -S' # Install specific package(s) from the repositories
alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
alias pacrep='pacman -Si' # Display information about a given package in the repositories
Expand Down
4 changes: 2 additions & 2 deletions plugins/compleat/compleat.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

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
autoload -U bashcompinit
bashcompinit -i
fi

source "$setup"
source "$setup"
fi
fi
6 changes: 3 additions & 3 deletions plugins/dirpersist/dirpersist.plugin.zsh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions plugins/django/django.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ _managepy-reset(){

_managepy-runfcgi(){
local state

local fcgi_opts
fcgi_opts=(
'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
Expand All @@ -99,7 +99,7 @@ _managepy-runfcgi(){
'outlog[write stdout to this file.]:file:_files'
'errlog[write stderr to this file.]:file:_files'
)

_arguments -s : \
$nul_args \
'*: :_values "FCGI Setting" $fcgi_opts' && ret=0
Expand Down Expand Up @@ -159,7 +159,7 @@ _managepy-validate() {

_managepy-commands() {
local -a commands

commands=(
'adminindex:prints the admin-index template snippet for the given app name(s).'
'createcachetable:creates the table needed to use the SQL cache backend.'
Expand Down Expand Up @@ -189,7 +189,7 @@ _managepy-commands() {
'testserver:Runs a development server with data from the given fixture(s).'
'validate:Validates all installed models.'
)

_describe -t commands 'manage.py command' commands && ret=0
}

Expand All @@ -207,7 +207,7 @@ _applist() {

_managepy() {
local curcontext=$curcontext ret=1

if ((CURRENT == 2)); then
_managepy-commands
else
Expand Down
8 changes: 4 additions & 4 deletions plugins/extract/extract.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function extract() {

remove_archive=1
if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
remove_archive=0
remove_archive=0
shift
fi

Expand Down Expand Up @@ -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 : $? ))
Expand Down
8 changes: 4 additions & 4 deletions plugins/knife/_knife
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _knife() {
'4: :->knifesubcmd3' \
'5: :->knifesubcmd4' \
'6: :->knifesubcmd5'

case $state in
knifecmd)
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
Expand All @@ -50,7 +50,7 @@ _knife() {
;;
role)
compadd -Q "$@" "bulk delete" create delete edit "from file" list show
;;
;;
windows)
compadd "$@" bootstrap
;;
Expand Down Expand Up @@ -117,8 +117,8 @@ _knife() {
else
_arguments '*:Subsubcommands:($(_knife_options2))'
fi
;;
knifesubcmd5)
;;
knifesubcmd5)
_arguments '*:Subsubcommands:($(_knife_options3))'
esac
}
Expand Down
8 changes: 4 additions & 4 deletions plugins/macports/_port
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,8 +31,8 @@ subcmds=(
'file'
'help'
'info'
'install'
'installed'
'install'
'installed'
'list'
'livecheck'
'location'
Expand All @@ -48,7 +48,7 @@ subcmds=(
'test'
'unarchive'
'uninstall'
'upgrade'
'upgrade'
'variants'
'version'
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/perl/perl.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions plugins/rvm/_rvm
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -116,7 +116,7 @@ case $state in
if (( CURRENT == 3 )); then
_values 'package_commands' \
'install' \
'uninstall'
'uninstall'
else
_values 'packages' \
'readline' \
Expand Down
2 changes: 1 addition & 1 deletion plugins/ssh-agent/ssh-agent.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function _plugin__start_agent()
. ${_plugin__ssh_env} > /dev/null

# load identies
zstyle -a :omz:plugins:ssh-agent identities identities
zstyle -a :omz:plugins:ssh-agent identities identities
echo starting...
/usr/bin/ssh-add $HOME/.ssh/${^identities}
}
Expand Down
6 changes: 3 additions & 3 deletions plugins/svn/svn.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function in_svn() {
function svn_get_repo_name {
if [ in_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
}
Expand All @@ -29,9 +29,9 @@ function svn_get_rev_nr {
function svn_dirty_choose {
if [ in_svn ]; then
s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null)
if [ $s ]; then
if [ $s ]; then
echo $1
else
else
echo $2
fi
fi
Expand Down
6 changes: 3 additions & 3 deletions plugins/vagrant/_vagrant
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#compdef vagrant
#compdef vagrant
#autoload

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

(box)
Expand Down
10 changes: 5 additions & 5 deletions themes/Soliah.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"

# Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"

# Text to display if the branch is clean
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_CLEAN=""

# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
Expand All @@ -35,7 +35,7 @@ function rvm_gemset() {
GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
if [[ -n $GEMSET ]]; then
echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
fi
fi

}

Expand All @@ -53,12 +53,12 @@ function git_time_since_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 30 ]; then
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
Expand Down
2 changes: 1 addition & 1 deletion themes/eastwood.zsh-theme
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#RVM settings
if [[ -s ~/.rvm/scripts/rvm ]] ; then
if [[ -s ~/.rvm/scripts/rvm ]] ; then
RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
fi

Expand Down
2 changes: 1 addition & 1 deletion themes/gallois.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git_custom_status() {
}

#RVM and git settings
if [[ -s ~/.rvm/scripts/rvm ]] ; then
if [[ -s ~/.rvm/scripts/rvm ]] ; then
RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
fi

Expand Down
20 changes: 10 additions & 10 deletions themes/jonathan.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ function precmd {

###
# Truncate the path if it's too long.

PR_FILLBAR=""
PR_PWDLEN=""

local promptsize=${#${(%):---(%n@%m:%l)---()--}}
local rubyprompt=`rvm_prompt_info`
local rubypromptsize=${#${rubyprompt}}
local pwdsize=${#${(%):-%~}}

if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then
((PR_PWDLEN=$TERMWIDTH - $promptsize))
else
Expand Down Expand Up @@ -69,7 +69,7 @@ setprompt () {

###
# See if we can use extended characters to look nicer.

typeset -A altchar
set -A altchar ${(s..)terminfo[acsc]}
PR_SET_CHARSET="%{$terminfo[enacs]%}"
Expand All @@ -81,10 +81,10 @@ setprompt () {
PR_LRCORNER=${altchar[j]:--}
PR_URCORNER=${altchar[k]:--}


###
# Decide if we need to set titlebar text.

case $TERM in
xterm*)
PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
Expand All @@ -96,17 +96,17 @@ setprompt () {
PR_TITLEBAR=''
;;
esac


###
# Decide whether to set a screen title
if [[ "$TERM" == "screen" ]]; then
PR_STITLE=$'%{\ekzsh\e\\%}'
else
PR_STITLE=''
fi


###
# Finally, the prompt.

Expand Down
Loading