1
0
Fork 0

extend the conditionals for all modules except utility

pull/341/head
Zeh Rizzatti 12 years ago
parent d2c14fecb9
commit b3f1d9ff2c

@ -26,6 +26,11 @@ unsetopt CLOBBER # Do not overwrite existing files with > and >>.
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all directory; then
return 1
fi
alias d='dirs -v' alias d='dirs -v'
for index ({1..9}) alias "$index"="cd +${index}"; unset index for index ({1..9}) alias "$index"="cd +${index}"; unset index

@ -16,6 +16,11 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all dpkg; then
return 1
fi
# Cleans the cache. # Cleans the cache.
alias debc='sudo apt-get clean && sudo apt-get autoclean' alias debc='sudo apt-get clean && sudo apt-get autoclean'

@ -49,6 +49,11 @@ function fasd_cd {
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all fasd; then
return 1
fi
# Changes the current working directory interactively. # Changes the current working directory interactively.
alias j='fasd_cd -i' alias j='fasd_cd -i'

@ -22,15 +22,15 @@ zstyle -s ':prezto:module:git:log:brief' format '_git_log_brief_format' \
zstyle -s ':prezto:module:git:status:ignore' submodules '_git_status_ignore_submodules' \ zstyle -s ':prezto:module:git:status:ignore' submodules '_git_status_ignore_submodules' \
|| _git_status_ignore_submodules='none' || _git_status_ignore_submodules='none'
#
# Aliases
#
# Return if conditions are unsatistied # Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all git; then if ! zstyle -t ':prezto:alias' pmodule all git; then
return 1 return 1
fi fi
#
# Aliases
#
# Git # Git
alias g='git' alias g='git'

@ -35,5 +35,10 @@ setopt HIST_BEEP # Beep when accessing non-existent history.
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all history; then
return 1
fi
# Lists the ten most used commands. # Lists the ten most used commands.
alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head" alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head"

@ -37,6 +37,11 @@ path=(
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all macports; then
return 1
fi
alias portc='sudo port clean --all installed' alias portc='sudo port clean --all installed'
alias porti='sudo port install' alias porti='sudo port install'
alias ports='port search' alias ports='port search'

@ -10,16 +10,6 @@ if [[ "$OSTYPE" != darwin* ]]; then
return 1 return 1
fi fi
#
# Aliases
#
# Change directory to the current Finder directory.
alias cdf='cd "$(pfd)"'
# Push directory to the current Finder directory.
alias pushdf='pushd "$(pfd)"'
# #
# Functions # Functions
# #
@ -37,3 +27,18 @@ function rm-osx-cruft {
\) -print0 | xargs -0 rm -rf \) -print0 | xargs -0 rm -rf
} }
#
# Aliases
#
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all osx; then
return 1
fi
# Change directory to the current Finder directory.
alias cdf='cd "$(pfd)"'
# Push directory to the current Finder directory.
alias pushdf='pushd "$(pfd)"'

@ -18,6 +18,11 @@ fi
# Frontend # Frontend
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all pacman; then
return 1
fi
# Get the Pacman frontend. # Get the Pacman frontend.
zstyle -s ':prezto:module:pacman' frontend '_pacman_frontend' zstyle -s ':prezto:module:pacman' frontend '_pacman_frontend'

@ -43,6 +43,11 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all perl; then
return 1
fi
# General # General
alias pl='perl' alias pl='perl'
alias pld='perldoc' alias pld='perldoc'

@ -42,6 +42,11 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all python; then
return 1
fi
alias py='python' alias py='python'
# pythonz # pythonz

@ -16,6 +16,11 @@ fi
# Aliases (Compatible with Rails 2) # Aliases (Compatible with Rails 2)
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all rails; then
return 1
fi
alias ror='rails' alias ror='rails'
alias rorc='_rails-command console' alias rorc='_rails-command console'
alias rordc='_rails-command dbconsole' alias rordc='_rails-command dbconsole'

@ -14,6 +14,11 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all rsync; then
return 1
fi
_rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' _rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system'
# Mac OS X and HFS+ Enhancements # Mac OS X and HFS+ Enhancements

@ -40,6 +40,11 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all ruby; then
return 1
fi
# General # General
alias rb='ruby' alias rb='ruby'

@ -32,6 +32,11 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all screen; then
return 1
fi
alias scr='screen' alias scr='screen'
alias scrl='screen -list' alias scrl='screen -list'
alias scrn='screen -U -S' alias scrn='screen -U -S'

@ -40,5 +40,10 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all tmux; then
return 1
fi
alias tmuxa='tmux attach-session' alias tmuxa='tmux attach-session'
alias tmuxl='tmux list-sessions' alias tmuxl='tmux list-sessions'

@ -13,10 +13,54 @@ pmodload 'helper' 'spectrum'
# Correct commands. # Correct commands.
setopt CORRECT setopt CORRECT
#
# Functions
#
# Makes a directory and changes to it.
function mkdcd {
[[ -n "$1" ]] && mkdir -p "$1" && builtin cd "$1"
}
# Changes to a directory and lists its contents.
function cdls {
builtin cd "$argv[-1]" && ls "${(@)argv[1,-2]}"
}
# Pushes an entry onto the directory stack and lists its contents.
function pushdls {
builtin pushd "$argv[-1]" && ls "${(@)argv[1,-2]}"
}
# Pops an entry off the directory stack and lists its contents.
function popdls {
builtin popd "$argv[-1]" && ls "${(@)argv[1,-2]}"
}
# Prints columns 1 2 3 ... n.
function slit {
awk "{ print ${(j:,:):-\$${^@}} }"
}
# Finds files and executes a command on them.
function find-exec {
find . -type f -iname "*${1:-}*" -exec "${2:-file}" '{}' \;
}
# Displays user owned processes status.
function psu {
ps -U "${1:-$USER}" -o 'pid,%cpu,%mem,command' "${(@)argv[2,-1]}"
}
# #
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all utility; then
return 1
fi
# Disable correction. # Disable correction.
alias ack='nocorrect ack' alias ack='nocorrect ack'
alias cd='nocorrect cd' alias cd='nocorrect cd'
@ -139,42 +183,3 @@ fi
# Serves a directory via HTTP. # Serves a directory via HTTP.
alias http-serve='python -m SimpleHTTPServer' alias http-serve='python -m SimpleHTTPServer'
#
# Functions
#
# Makes a directory and changes to it.
function mkdcd {
[[ -n "$1" ]] && mkdir -p "$1" && builtin cd "$1"
}
# Changes to a directory and lists its contents.
function cdls {
builtin cd "$argv[-1]" && ls "${(@)argv[1,-2]}"
}
# Pushes an entry onto the directory stack and lists its contents.
function pushdls {
builtin pushd "$argv[-1]" && ls "${(@)argv[1,-2]}"
}
# Pops an entry off the directory stack and lists its contents.
function popdls {
builtin popd "$argv[-1]" && ls "${(@)argv[1,-2]}"
}
# Prints columns 1 2 3 ... n.
function slit {
awk "{ print ${(j:,:):-\$${^@}} }"
}
# Finds files and executes a command on them.
function find-exec {
find . -type f -iname "*${1:-}*" -exec "${2:-file}" '{}' \;
}
# Displays user owned processes status.
function psu {
ps -U "${1:-$USER}" -o 'pid,%cpu,%mem,command' "${(@)argv[2,-1]}"
}

@ -15,6 +15,11 @@ fi
# Aliases # Aliases
# #
# Return if conditions are unsatistied
if ! zstyle -t ':prezto:alias' pmodule all yum; then
return 1
fi
alias yumc='sudo yum clean all' # Cleans the cache. alias yumc='sudo yum clean all' # Cleans the cache.
alias yumh='yum history' # Displays history. alias yumh='yum history' # Displays history.
alias yumi='sudo yum install' # Installs package(s). alias yumi='sudo yum install' # Installs package(s).

Loading…
Cancel
Save