1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-15 04:41:43 +00:00

[Fix #60] Do not use parentheses in function names

This commit is contained in:
Sorin Ionescu
2012-03-23 14:57:51 -04:00
parent a3b92bb053
commit 6a9a4ea8d6
22 changed files with 66 additions and 67 deletions

View File

@ -86,7 +86,7 @@ alias giu='git add --update'
compdef _git giu=git-add
alias gid='git diff --no-ext-diff --cached'
compdef _git gid=git-diff
function giD() { git diff --no-ext-diff --cached --ignore-all-space "$@" | view - }
function giD { git diff --no-ext-diff --cached --ignore-all-space "$@" | view - }
compdef _git giD=git-diff
alias gir='git reset'
compdef _git gir=git-reset
@ -235,7 +235,7 @@ alias gwS='git status'
compdef _git gwS=git-status
alias gwd='git diff --no-ext-diff'
compdef _git gwd=git-diff
function gwD() { git diff --no-ext-diff --ignore-all-space "$@" | view - }
function gwD { git diff --no-ext-diff --ignore-all-space "$@" | view - }
compdef _git gwD=git-diff
alias gwr='git reset --soft'
compdef _git gwr=git-reset

View File

@ -6,7 +6,7 @@
#
# Gets the path to the Git directory.
function _git-dir() {
function _git-dir {
local git_root="$(git-root)"
local git_dir_or_file="${git_root}/.git"
local git_dir
@ -31,7 +31,7 @@ function _git-dir() {
# Gets the Git special action (am, merge, rebase, etc.).
# Borrowed from vcs_info and edited.
function _git-action() {
function _git-action {
local action=''
local action_dir
local git_dir="$(_git-dir)"
@ -90,7 +90,7 @@ function _git-action() {
}
# Turns off git-info for the current repository.
function _git-info-abort() {
function _git-info-abort {
if ! is-true "$_git_info_executing"; then
return 1
fi
@ -115,7 +115,7 @@ EOF
add-zsh-trap INT _git-info-abort
# Gets the Git status information.
function git-info() {
function git-info {
# Extended globbing is needed to parse repository status.
setopt LOCAL_OPTIONS
setopt EXTENDED_GLOB

View File

@ -7,7 +7,7 @@
#
if (( $+commands[hub] )); then
function git() {
function git {
hub "$@"
}
fi

View File

@ -6,7 +6,7 @@
#
if (( $+commands[gdircolors] )); then
function __gnu_utils() {
function __gnu_utils {
emulate -L zsh
local gcmds
local gcmd
@ -46,7 +46,7 @@ if (( $+commands[gdircolors] )); then
}
__gnu_utils;
function hash() {
function hash {
if (( $+argv[(er)-r] )) || (( $+argv[(er)-f] )); then
builtin hash "$@"
__gnu_utils
@ -55,7 +55,7 @@ if (( $+commands[gdircolors] )); then
fi
}
function rehash() {
function rehash {
hash -r "$@"
}

View File

@ -12,7 +12,7 @@ fi
_gpg_env="$HOME/.gnupg/gpg-agent.env"
function _gpg-agent-start() {
function _gpg-agent-start {
gpg-agent --daemon --enable-ssh-support --write-env-file "${_gpg_env}" > /dev/null
chmod 600 "${_gpg_env}"
source "${_gpg_env}" > /dev/null

View File

@ -49,7 +49,7 @@ HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i'
# the main ZLE widgets
#-----------------------------------------------------------------------------
function history-substring-search-up() {
function history-substring-search-up {
_history-substring-search-begin
_history-substring-search-up-history ||
@ -59,7 +59,7 @@ function history-substring-search-up() {
_history-substring-search-end
}
function history-substring-search-down() {
function history-substring-search-down {
_history-substring-search-begin
_history-substring-search-down-history ||
@ -93,7 +93,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
# simply removes any existing highlights when the
# user inserts printable characters into $BUFFER.
#
function _zsh_highlight() {
function _zsh_highlight {
if [[ $KEYS == [[:print:]] ]]; then
region_highlight=()
fi
@ -136,8 +136,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
#
#--------------8<-------------------8<-------------------8<-----------------
# Rebind all ZLE widgets to make them invoke _zsh_highlights.
_zsh_highlight_bind_widgets()
{
function _zsh_highlight_bind_widgets {
# Load Zsh module zsh/zleparameter, needed to override user defined widgets.
zmodload zsh/zleparameter 2>/dev/null || {
print 'history-substring-search: failed loading: zsh/zleparameter' >&2
@ -163,7 +162,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Builtin widget: override and make it call the builtin ".widget".
builtin) eval "_zsh_highlight_widget_$cur_widget() { builtin zle .$cur_widget -- \"\$@\" && _zsh_highlight }; \
builtin) eval "function _zsh_highlight_widget_$cur_widget { builtin zle .$cur_widget -- \"\$@\" && _zsh_highlight }; \
zle -N $cur_widget _zsh_highlight_widget_$cur_widget";;
# Default: unhandled case.
@ -176,7 +175,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
_zsh_highlight_bind_widgets
fi
function _history-substring-search-begin() {
function _history-substring-search-begin {
setopt LOCAL_OPTIONS EXTENDED_GLOB
_history_substring_search_move_cursor_eol=false
@ -244,7 +243,7 @@ function _history-substring-search-begin() {
fi
}
function _history-substring-search-end() {
function _history-substring-search-end {
setopt LOCAL_OPTIONS EXTENDED_GLOB
_history_substring_search_result=$BUFFER
@ -278,7 +277,7 @@ function _history-substring-search-end() {
true
}
function _history-substring-search-up-buffer() {
function _history-substring-search-up-buffer {
#
# Check if the UP arrow was pressed to move the cursor within a multi-line
# buffer. This amounts to three tests:
@ -307,7 +306,7 @@ function _history-substring-search-up-buffer() {
false
}
function _history-substring-search-down-buffer() {
function _history-substring-search-down-buffer {
#
# Check if the DOWN arrow was pressed to move the cursor within a multi-line
# buffer. This amounts to three tests:
@ -336,7 +335,7 @@ function _history-substring-search-down-buffer() {
false
}
function _history-substring-search-up-history() {
function _history-substring-search-up-history {
#
# Behave like up in Zsh, except clear the $BUFFER
# when beginning of history is reached like in Fish.
@ -358,7 +357,7 @@ function _history-substring-search-up-history() {
false
}
function _history-substring-search-down-history() {
function _history-substring-search-down-history {
#
# Behave like down-history in Zsh, except clear the
# $BUFFER when end of history is reached like in Fish.
@ -381,7 +380,7 @@ function _history-substring-search-down-history() {
false
}
function _history-substring-search-up-search() {
function _history-substring-search-up-search {
_history_substring_search_move_cursor_eol=true
#
@ -460,7 +459,7 @@ function _history-substring-search-up-search() {
fi
}
function _history-substring-search-down-search() {
function _history-substring-search-down-search {
_history_substring_search_move_cursor_eol=true
#

View File

@ -5,7 +5,7 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
function manb() {
function manb {
local page
if (( $# > 0 )); then
for page in "$@"; do

View File

@ -5,7 +5,7 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
function manp() {
function manp {
local page
if (( $# > 0 )); then
for page in "$@"; do

View File

@ -12,12 +12,12 @@ alias cdf='cd "$(pfd)"'
alias pushdf='pushd "$(pfd)"'
# Open files in Quick Look.
function ql() {
function ql {
(( $# > 0 )) && qlmanage -p "$@" &> /dev/null
}
# Delete .DS_Store and __MACOSX directories.
function rm-osx-cruft() {
function rm-osx-cruft {
find "${@:-$PWD}" \( \
-type f -name '.DS_Store' -o \
-type d -name '__MACOSX' \

View File

@ -20,7 +20,7 @@ alias rsd='_rails-command server --debugger'
alias devlog='tail -f log/development.log'
# Functions
function _rails-command() {
function _rails-command {
if [[ -e "script/server" ]]; then
ruby script/"$@"
else

View File

@ -27,7 +27,7 @@ fi
_ssh_agent_env="${HOME}/.ssh/environment-${HOST}"
_ssh_agent_forwarding=
function _ssh-agent-start() {
function _ssh-agent-start {
local -a identities
# Start ssh-agent and setup the environment.

View File

@ -16,7 +16,7 @@ fi
if (( $+functions[_z] )); then
alias z='nocorrect _z 2>&1'
alias j='z'
function z-precmd () {
function z-precmd {
z --add "$(pwd -P)"
}
autoload -Uz add-zsh-hook