diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 07e21976f9..eec4c165b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,4 +39,3 @@ improve its performance, do not hesitate to fork and send pull requests. [3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [4]: https://help.github.com/articles/using-pull-requests [5]: http://daringfireball.net/projects/markdown/syntax#img - diff --git a/README.md b/README.md index 24445cb53f..c9d3fd41e2 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ and prompt themes. Installation ------------ -Prezto will work with any recent release of Zsh, but the minimum recommended -version is 4.3.11. +Prezto will work with any recent release of Zsh, but the minimum required +version is 4.3.17. 1. Launch Zsh: @@ -114,4 +114,3 @@ SOFTWARE. [6]: http://gitref.org [7]: http://www.bash2zsh.com/zsh_refcard/refcard.pdf [8]: http://grml.org/zsh/zsh-lovers.html - diff --git a/init.zsh b/init.zsh index 75adfe519d..6b5254fb4c 100644 --- a/init.zsh +++ b/init.zsh @@ -10,7 +10,7 @@ # # Check for the minimum supported version. -min_zsh_version='4.3.11' +min_zsh_version='4.3.17' if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then print "prezto: old shell detected, minimum required: $min_zsh_version" >&2 return 1 @@ -111,4 +111,3 @@ unset zfunction{s,} zstyle -a ':prezto:load' pmodule 'pmodules' pmodload "$pmodules[@]" unset pmodules - diff --git a/modules/README.md b/modules/README.md index 42583980d0..4d247b2434 100644 --- a/modules/README.md +++ b/modules/README.md @@ -102,10 +102,10 @@ Node.js Provides utility functions for Node.js and loads npm completion. -Ocaml +OCaml ----- -Initializes Ocaml package management. +Initializes OCaml package management. OSX --- @@ -192,4 +192,3 @@ Yum --- Defines yum aliases. - diff --git a/modules/archive/README.md b/modules/archive/README.md index 64b95df7aa..a1d49011a3 100644 --- a/modules/archive/README.md +++ b/modules/archive/README.md @@ -38,4 +38,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/archive/functions/_lsarchive b/modules/archive/functions/_lsarchive index 516a8a3357..00f83e0584 100644 --- a/modules/archive/functions/_lsarchive +++ b/modules/archive/functions/_lsarchive @@ -11,4 +11,3 @@ _arguments \ '(-v --verbose)'{-v,--remove}'[verbose archive listing]' \ "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z)(-.)'" && return 0 - diff --git a/modules/archive/functions/_unarchive b/modules/archive/functions/_unarchive index a446cb4a3d..aceb27b639 100644 --- a/modules/archive/functions/_unarchive +++ b/modules/archive/functions/_unarchive @@ -11,4 +11,3 @@ _arguments \ '(-r --remove)'{-r,--remove}'[remove archive]' \ "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 - diff --git a/modules/archive/functions/lsarchive b/modules/archive/functions/lsarchive index bac540f884..7ac6145056 100644 --- a/modules/archive/functions/lsarchive +++ b/modules/archive/functions/lsarchive @@ -30,7 +30,7 @@ while (( $# > 0 )); do continue fi - case "$1" in + case "$1:l" in (*.tar.gz|*.tgz) tar t${verbose:+v}vzf "$1" ;; (*.tar.bz2|*.tbz|*.tbz2) tar t${verbose:+v}jf "$1" ;; (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ @@ -46,11 +46,10 @@ while (( $# > 0 )); do || rar ${${verbose:+v}:-l} "$1" ;; (*.7z) 7za l "$1" ;; (*) - print "$0: cannot list: $1" >&2 + print "$0: cannot list: $1" >&2 success=1 ;; esac shift done - diff --git a/modules/archive/functions/unarchive b/modules/archive/functions/unarchive index 36fe85b6ff..f1b4224aa6 100644 --- a/modules/archive/functions/unarchive +++ b/modules/archive/functions/unarchive @@ -37,7 +37,7 @@ while (( $# > 0 )); do success=0 file_name="${1:t}" extract_dir="${file_name:r}" - case "$1" in + case "$1:l" in (*.tar.gz|*.tgz) tar xvzf "$1" ;; (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ @@ -54,8 +54,8 @@ while (( $# > 0 )); do (*.Z) uncompress "$1" ;; (*.zip) unzip "$1" -d $extract_dir ;; (*.rar) unrar &> /dev/null \ - && unrar e -ad "$1" \ - || rar e -ad "$1" ;; + && unrar x -ad "$1" \ + || rar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) mkdir -p "$extract_dir/control" @@ -76,4 +76,3 @@ while (( $# > 0 )); do (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" shift done - diff --git a/modules/command-not-found/README.md b/modules/command-not-found/README.md index 691806a427..e969b71af2 100644 --- a/modules/command-not-found/README.md +++ b/modules/command-not-found/README.md @@ -13,4 +13,3 @@ Authors [1]: https://code.launchpad.net/command-not-found [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh index c4d1b9f9ee..2d9236a00b 100644 --- a/modules/command-not-found/init.zsh +++ b/modules/command-not-found/init.zsh @@ -15,4 +15,3 @@ elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then else return 1 fi - diff --git a/modules/completion/README.md b/modules/completion/README.md index 83034b5df9..aaa86fdd2b 100644 --- a/modules/completion/README.md +++ b/modules/completion/README.md @@ -21,4 +21,3 @@ Authors [1]: https://github.com/zsh-users/zsh-completions [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 3ffad63318..28c20905d2 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -116,7 +116,7 @@ zstyle ':completion:*:(rm|kill|diff):*' ignore-line other zstyle ':completion:*:rm:*' file-patterns '*:all-files' # Kill -zstyle ':completion:*:*:*:*:processes' command 'ps -u $USER -o pid,user,comm -w' +zstyle ':completion:*:*:*:*:processes' command 'ps -u $USER -o pid,user,command -w' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01' zstyle ':completion:*:*:kill:*' menu yes select zstyle ':completion:*:*:kill:*' force-list always @@ -146,4 +146,3 @@ zstyle ':completion:*:ssh:*' group-order users hosts-domain hosts-host users hos zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' - diff --git a/modules/directory/README.md b/modules/directory/README.md index 6572bb7272..47c1bc201b 100644 --- a/modules/directory/README.md +++ b/modules/directory/README.md @@ -33,4 +33,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/directory/init.zsh b/modules/directory/init.zsh index 3be411b5a5..47191dfe4f 100644 --- a/modules/directory/init.zsh +++ b/modules/directory/init.zsh @@ -28,4 +28,3 @@ unsetopt CLOBBER # Do not overwrite existing files with > and >>. alias d='dirs -v' for index ({1..9}) alias "$index"="cd +${index}"; unset index - diff --git a/modules/dpkg/README.md b/modules/dpkg/README.md index 98af6c386b..6290c05afc 100644 --- a/modules/dpkg/README.md +++ b/modules/dpkg/README.md @@ -39,4 +39,3 @@ Authors [1]: http://wiki.debian.org/Teams/Dpkg [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/dpkg/functions/deb-clone b/modules/dpkg/functions/deb-clone index a80874a75f..a284c96fc0 100644 --- a/modules/dpkg/functions/deb-clone +++ b/modules/dpkg/functions/deb-clone @@ -23,4 +23,3 @@ rm "$clone_script" print '#!/bin/sh\n' > "$clone_script" print "aptitude install ${package_list}\n" >> "$clone_script" chmod +x "$clone_script" - diff --git a/modules/dpkg/functions/deb-history b/modules/dpkg/functions/deb-history index a5a1ee86c2..3737679031 100644 --- a/modules/dpkg/functions/deb-history +++ b/modules/dpkg/functions/deb-history @@ -34,4 +34,3 @@ Commands: EOF ;; esac - diff --git a/modules/dpkg/functions/deb-kbuild b/modules/dpkg/functions/deb-kbuild index 1120e1a7c3..bdf7801e5b 100644 --- a/modules/dpkg/functions/deb-kbuild +++ b/modules/dpkg/functions/deb-kbuild @@ -12,4 +12,3 @@ MAKEFLAGS='' time fakeroot make-kpkg \ --revision "$(date +"%Y%m%d")" \ kernel_image \ kernel_headers - diff --git a/modules/dpkg/init.zsh b/modules/dpkg/init.zsh index fbbc8bc5c9..e1f479b090 100644 --- a/modules/dpkg/init.zsh +++ b/modules/dpkg/init.zsh @@ -55,4 +55,3 @@ alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc' # Removes all kernel images and headers, except for the ones in use. alias deb-kclean='sudo aptitude remove -P "?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))"' - diff --git a/modules/editor/README.md b/modules/editor/README.md index d989e35c5d..da0185fd18 100644 --- a/modules/editor/README.md +++ b/modules/editor/README.md @@ -49,8 +49,7 @@ To indicate when the editor is completing, add the following to your zstyle ':prezto:module:editor:info:completing' format '...' Then add `$editor_info[context]`, where context is *keymap*, *insert*, or -*overwrite*, to `$PROMPT` or `$RPROMPT` and call `editor-info` in the -`prompt_name_preexec` hook function. +*overwrite*, to `$PROMPT` or `$RPROMPT`. Authors ------- @@ -60,4 +59,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/oh-my-zsh/issues - diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 9a347a0948..9aa64d643c 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -28,40 +28,42 @@ WORDCHARS='*?_-.[]~&;!#$%^(){}<>' zmodload zsh/terminfo typeset -gA key_info key_info=( - 'Control' '\C-' - 'Escape' '\e' - 'Meta' '\M-' - 'Backspace' "^?" - 'Delete' "^[[3~" - 'F1' "$terminfo[kf1]" - 'F2' "$terminfo[kf2]" - 'F3' "$terminfo[kf3]" - 'F4' "$terminfo[kf4]" - 'F5' "$terminfo[kf5]" - 'F6' "$terminfo[kf6]" - 'F7' "$terminfo[kf7]" - 'F8' "$terminfo[kf8]" - 'F9' "$terminfo[kf9]" - 'F10' "$terminfo[kf10]" - 'F11' "$terminfo[kf11]" - 'F12' "$terminfo[kf12]" - 'Insert' "$terminfo[kich1]" - 'Home' "$terminfo[khome]" - 'PageUp' "$terminfo[kpp]" - 'End' "$terminfo[kend]" - 'PageDown' "$terminfo[knp]" - 'Up' "$terminfo[kcuu1]" - 'Left' "$terminfo[kcub1]" - 'Down' "$terminfo[kcud1]" - 'Right' "$terminfo[kcuf1]" - 'BackTab' "$terminfo[kcbt]" + 'Control' '\C-' + 'ControlLeft' '\e[1;5D \e[5D \e\e[D \eOd' + 'ControlRight' '\e[1;5C \e[5C \e\e[C \eOc' + 'Escape' '\e' + 'Meta' '\M-' + 'Backspace' "^?" + 'Delete' "^[[3~" + 'F1' "$terminfo[kf1]" + 'F2' "$terminfo[kf2]" + 'F3' "$terminfo[kf3]" + 'F4' "$terminfo[kf4]" + 'F5' "$terminfo[kf5]" + 'F6' "$terminfo[kf6]" + 'F7' "$terminfo[kf7]" + 'F8' "$terminfo[kf8]" + 'F9' "$terminfo[kf9]" + 'F10' "$terminfo[kf10]" + 'F11' "$terminfo[kf11]" + 'F12' "$terminfo[kf12]" + 'Insert' "$terminfo[kich1]" + 'Home' "$terminfo[khome]" + 'PageUp' "$terminfo[kpp]" + 'End' "$terminfo[kend]" + 'PageDown' "$terminfo[knp]" + 'Up' "$terminfo[kcuu1]" + 'Left' "$terminfo[kcub1]" + 'Down' "$terminfo[kcud1]" + 'Right' "$terminfo[kcuf1]" + 'BackTab' "$terminfo[kcbt]" ) # Set empty $key_info values to an invalid UTF-8 sequence to induce silent # bindkey failure. for key in "${(k)key_info[@]}"; do if [[ -z "$key_info[$key]" ]]; then - key_info["$key"]='�' + key_info[$key]='�' fi done @@ -206,10 +208,10 @@ bindkey -d # Emacs Key Bindings # -for key ("$key_info[Escape]"{B,b}) bindkey -M emacs "$key" emacs-backward-word -for key ("$key_info[Escape]"{F,f}) bindkey -M emacs "$key" emacs-forward-word -bindkey -M emacs "$key_info[Escape]$key_info[Left]" emacs-backward-word -bindkey -M emacs "$key_info[Escape]$key_info[Right]" emacs-forward-word +for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" + bindkey -M emacs "$key" emacs-backward-word +for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" + bindkey -M emacs "$key" emacs-forward-word # Kill to the beginning of the line. for key in "$key_info[Escape]"{K,k} @@ -325,4 +327,3 @@ else fi unset key{,map,bindings} - diff --git a/modules/environment/README.md b/modules/environment/README.md index 0291861160..b86cbc54af 100644 --- a/modules/environment/README.md +++ b/modules/environment/README.md @@ -23,4 +23,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/environment/init.zsh b/modules/environment/init.zsh index d05aa07b0c..51d26162f5 100644 --- a/modules/environment/init.zsh +++ b/modules/environment/init.zsh @@ -55,4 +55,3 @@ if zstyle -t ':prezto:environment:termcap' color; then export LESS_TERMCAP_ue=$'\E[0m' # Ends underline. export LESS_TERMCAP_us=$'\E[01;32m' # Begins underline. fi - diff --git a/modules/fasd/README.md b/modules/fasd/README.md index 5cfc2cc75d..7d22626cf4 100644 --- a/modules/fasd/README.md +++ b/modules/fasd/README.md @@ -36,4 +36,3 @@ Authors [3]: https://github.com/rupa/z [4]: https://github.com/rupa/v [5]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/fasd/init.zsh b/modules/fasd/init.zsh index 7088e9c681..fc2142510c 100644 --- a/modules/fasd/init.zsh +++ b/modules/fasd/init.zsh @@ -51,4 +51,3 @@ function fasd_cd { # Changes the current working directory interactively. alias j='fasd_cd -i' - diff --git a/modules/git/README.md b/modules/git/README.md index 0dd932f6b2..c2d0449c74 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -332,4 +332,3 @@ Authors [6]: https://github.com/sorin-ionescu/prezto/issues [7]: https://github.com/sorin-ionescu/prezto/issues/219 [8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html - diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index bf6d3644ae..ffa854ddb3 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -100,12 +100,12 @@ alias gix='git rm -r --cached' alias giX='git rm -rf --cached' # Log (l) -alias gl='git log --topo-order --pretty=format:${_git_log_medium_format}' -alias gls='git log --topo-order --stat --pretty=format:${_git_log_medium_format}' -alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:${_git_log_medium_format}' -alias glo='git log --topo-order --pretty=format:${_git_log_oneline_format}' -alias glg='git log --topo-order --all --graph --pretty=format:${_git_log_oneline_format}' -alias glb='git log --topo-order --pretty=format:${_git_log_brief_format}' +alias gl='git log --topo-order --pretty=format:"${_git_log_medium_format}"' +alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"' +alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"' +alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"' +alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"' +alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"' alias glc='git shortlog --summary --numbered' # Merge (m) @@ -179,4 +179,3 @@ alias gwc='git clean -n' alias gwC='git clean -f' alias gwx='git rm -r' alias gwX='git rm -rf' - diff --git a/modules/git/functions/_git-hub-browse b/modules/git/functions/_git-hub-browse index 0085c18886..54d223f275 100644 --- a/modules/git/functions/_git-hub-browse +++ b/modules/git/functions/_git-hub-browse @@ -45,4 +45,3 @@ case "$state" in esac return $ret - diff --git a/modules/git/functions/_git-hub-shorten-url b/modules/git/functions/_git-hub-shorten-url index 32199cee7a..dcc7bb3880 100644 --- a/modules/git/functions/_git-hub-shorten-url +++ b/modules/git/functions/_git-hub-shorten-url @@ -9,4 +9,3 @@ # _arguments '1:url:' && return 0 - diff --git a/modules/git/functions/_git-info b/modules/git/functions/_git-info index c1467e84bb..1e21bfeb1a 100644 --- a/modules/git/functions/_git-info +++ b/modules/git/functions/_git-info @@ -16,4 +16,3 @@ _arguments "1:toggle:(( on\:'enable in-prompt information for the current repository' off\:'disable in-prompt information for the current repository' ))" && return 0 - diff --git a/modules/git/functions/_git-submodule-move b/modules/git/functions/_git-submodule-move index ab8cd1ba17..44eddb5402 100644 --- a/modules/git/functions/_git-submodule-move +++ b/modules/git/functions/_git-submodule-move @@ -38,4 +38,3 @@ case "$state" in esac return $ret - diff --git a/modules/git/functions/_git-submodule-remove b/modules/git/functions/_git-submodule-remove index 1460dd0ec4..87bd7cb006 100644 --- a/modules/git/functions/_git-submodule-remove +++ b/modules/git/functions/_git-submodule-remove @@ -24,4 +24,3 @@ done < <( ) _describe -t submodule 'submodules' submodules && return 0 - diff --git a/modules/git/functions/git-branch-current b/modules/git/functions/git-branch-current index c731958d90..944ffe25cd 100644 --- a/modules/git/functions/git-branch-current +++ b/modules/git/functions/git-branch-current @@ -18,4 +18,3 @@ if [[ -n "$ref" ]]; then else return 1 fi - diff --git a/modules/git/functions/git-commit-lost b/modules/git/functions/git-commit-lost index e4075c9b75..75ab571655 100644 --- a/modules/git/functions/git-commit-lost +++ b/modules/git/functions/git-commit-lost @@ -18,4 +18,3 @@ git fsck 2> /dev/null \ --no-walk \ --stdin \ --pretty=format:${_git_log_oneline_format} - diff --git a/modules/git/functions/git-dir b/modules/git/functions/git-dir index 2e40e9eace..7e16ca8140 100644 --- a/modules/git/functions/git-dir +++ b/modules/git/functions/git-dir @@ -14,4 +14,3 @@ else print "$0: not a repository: $PWD" >&2 return 1 fi - diff --git a/modules/git/functions/git-hub-browse b/modules/git/functions/git-hub-browse index 80fddca044..549a544ab7 100644 --- a/modules/git/functions/git-hub-browse +++ b/modules/git/functions/git-hub-browse @@ -56,4 +56,3 @@ else print "$0: not a Git repository or remote not set" >&2 return 1 fi - diff --git a/modules/git/functions/git-hub-shorten-url b/modules/git/functions/git-hub-shorten-url index c394f5b807..77e4b0bacf 100644 --- a/modules/git/functions/git-hub-shorten-url +++ b/modules/git/functions/git-hub-shorten-url @@ -20,4 +20,3 @@ if (( $+commands[curl] )); then else print "$0: command not found: curl" >&2 fi - diff --git a/modules/git/functions/git-info b/modules/git/functions/git-info index bc6272402f..8aaa4c32d6 100644 --- a/modules/git/functions/git-info +++ b/modules/git/functions/git-info @@ -421,4 +421,3 @@ function git-info { } git-info "$@" - diff --git a/modules/git/functions/git-root b/modules/git/functions/git-root index 82b74385e0..712e4fe6b4 100644 --- a/modules/git/functions/git-root +++ b/modules/git/functions/git-root @@ -14,4 +14,3 @@ else print "$0: not a repository work tree: $PWD" >&2 return 1 fi - diff --git a/modules/git/functions/git-stash-clear-interactive b/modules/git/functions/git-stash-clear-interactive index effd038f7f..e45165c499 100644 --- a/modules/git/functions/git-stash-clear-interactive +++ b/modules/git/functions/git-stash-clear-interactive @@ -20,4 +20,3 @@ if [[ -f "$(git-dir)/refs/stash" ]]; then fi fi fi - diff --git a/modules/git/functions/git-stash-dropped b/modules/git/functions/git-stash-dropped index 26229263b4..51580703f2 100644 --- a/modules/git/functions/git-stash-dropped +++ b/modules/git/functions/git-stash-dropped @@ -20,4 +20,3 @@ git fsck --unreachable 2> /dev/null \ --merges \ --no-walk \ --stdin - diff --git a/modules/git/functions/git-stash-recover b/modules/git/functions/git-stash-recover index 0709440638..6add26fdd9 100644 --- a/modules/git/functions/git-stash-recover +++ b/modules/git/functions/git-stash-recover @@ -16,4 +16,3 @@ for commit in "$@"; do git update-ref \ -m "$(git log -1 --pretty="format:%s" "$commit")" refs/stash "$commit" done - diff --git a/modules/git/functions/git-submodule-move b/modules/git/functions/git-submodule-move index c3db972d02..34c5e44aba 100644 --- a/modules/git/functions/git-submodule-move +++ b/modules/git/functions/git-submodule-move @@ -30,4 +30,3 @@ git-submodule-remove "$src" git submodule add "$url" "$dst" return 0 - diff --git a/modules/git/functions/git-submodule-remove b/modules/git/functions/git-submodule-remove index 3f72fb6d87..852b9cdbc8 100644 --- a/modules/git/functions/git-submodule-remove +++ b/modules/git/functions/git-submodule-remove @@ -25,4 +25,3 @@ rm -rf "${1}" rm -rf "$(git-dir)/modules/${1}" return 0 - diff --git a/modules/git/init.zsh b/modules/git/init.zsh index 3a618f23fa..ba54082855 100644 --- a/modules/git/init.zsh +++ b/modules/git/init.zsh @@ -15,4 +15,3 @@ pmodload 'helper' # Source module files. source "${0:h}/alias.zsh" - diff --git a/modules/gnu-utility/README.md b/modules/gnu-utility/README.md index b3b6ded1df..34bc6635aa 100644 --- a/modules/gnu-utility/README.md +++ b/modules/gnu-utility/README.md @@ -1,7 +1,7 @@ GNU Utility =========== -Provides for the interactive use of GNU utilities on non-GNU systems. +Provides for the interactive use of GNU utilities on BSD systems. Installing GNU utilities on non-GNU systems in `$PATH` without a prefix, i.e. `ls` instead of `gls`, is not recommended since scripts that target other @@ -30,4 +30,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/gnu-utility/init.zsh b/modules/gnu-utility/init.zsh index a38123148a..6556032407 100644 --- a/modules/gnu-utility/init.zsh +++ b/modules/gnu-utility/init.zsh @@ -58,4 +58,3 @@ for _gnu_utility_cmd in "${_gnu_utility_cmds[@]}"; do done unset _gnu_utility_{p,cmds,cmd,pcmd} - diff --git a/modules/gpg/README.md b/modules/gpg/README.md index b13e33e9bb..80e91d0ff6 100644 --- a/modules/gpg/README.md +++ b/modules/gpg/README.md @@ -24,4 +24,3 @@ Authors [1]: http://www.gnupg.org [2]: http://linux.die.net/man/1/gpg-agent [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index 48f1715a83..0bb7476cc1 100644 --- a/modules/gpg/init.zsh +++ b/modules/gpg/init.zsh @@ -15,11 +15,14 @@ _gpg_agent_conf="$HOME/.gnupg/gpg-agent.conf" _gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env" # Start gpg-agent if not started. -if ! ps -U "$USER" -o ucomm | grep -q gpg-agent; then - eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")" -else +if [[ -z "$GPG_AGENT_INFO" ]]; then # Export environment variables. source "$_gpg_agent_env" 2> /dev/null + + # Start gpg-agent if not started. + if ! ps -U "$USER" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then + eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")" + fi fi # Inform gpg-agent of the current TTY for user prompts. @@ -41,4 +44,3 @@ unset _gpg_agent_{conf,env} if [[ -n "$SSH_CONNECTION" ]]; then export PINENTRY_USER_DATA='USE_CURSES=1' fi - diff --git a/modules/haskell/README.md b/modules/haskell/README.md index 512350d59c..dcf144c6bc 100644 --- a/modules/haskell/README.md +++ b/modules/haskell/README.md @@ -26,4 +26,3 @@ Authors [1]: http://www.haskell.org/cabal/ [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/helper/README.md b/modules/helper/README.md index b010b00539..9f10d6eedf 100644 --- a/modules/helper/README.md +++ b/modules/helper/README.md @@ -22,4 +22,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/helper/functions/add-zsh-trap b/modules/helper/functions/add-zsh-trap index c8796ca0d5..07663e9d6a 100644 --- a/modules/helper/functions/add-zsh-trap +++ b/modules/helper/functions/add-zsh-trap @@ -39,4 +39,3 @@ function add-zsh-trap { } add-zsh-trap "$@" - diff --git a/modules/helper/init.zsh b/modules/helper/init.zsh index 7e0f9d574e..9d792186d4 100644 --- a/modules/helper/init.zsh +++ b/modules/helper/init.zsh @@ -29,4 +29,3 @@ function coalesce { done return 1 } - diff --git a/modules/history-substring-search/README.md b/modules/history-substring-search/README.md index 27a4a78f46..79714fa921 100644 --- a/modules/history-substring-search/README.md +++ b/modules/history-substring-search/README.md @@ -59,4 +59,3 @@ Authors [1]: https://github.com/zsh-users/zsh-history-substring-search [2]: http://fishshell.com [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index 0fc191d84f..67990a3822 100644 --- a/modules/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -55,4 +55,3 @@ if [[ -n "$key_info" ]]; then bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down done fi - diff --git a/modules/history/README.md b/modules/history/README.md index 7875ca586b..3dc9a26423 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -41,4 +41,3 @@ Authors [1]: http://zsh.sourceforge.net/Guide/zshguide02.html#l16 [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md index c8e6d4e2cb..69a4e87b9f 100644 --- a/modules/homebrew/README.md +++ b/modules/homebrew/README.md @@ -6,6 +6,8 @@ Defines Homebrew aliases. Aliases ------- +### Homebrew + - `brewc` cleans outdated brews and their cached archives. - `brewC` cleans outdated brews, including keg-only, and their cached archives. - `brewi` installs a formula. @@ -15,12 +17,22 @@ Aliases - `brewu` upgrades Homebrew. - `brewx` uninstalls a formula. +### Homebrew Cask + + - `cask` is aliased to `brew cask`. + - `caskc` cleans up old cached downloads. + - `caskC` cleans up all cached downloads. + - `caski` installs a cask. + - `caskl` lists installed casks. + - `casks` searches for a cask. + - `caskx` uninstalls a cask. + Authors ------- *The authors of this module should be contacted via the [issue tracker][1].* - [Sorin Ionescu](https://github.com/sorin-ionescu) + - [Griffin Yourick](https://github.com/tough-griff) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 6f0299af99..101b6b9731 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -14,6 +14,7 @@ fi # Aliases # +# Homebrew alias brewc='brew cleanup' alias brewC='brew cleanup --force' alias brewi='brew install' @@ -23,3 +24,11 @@ alias brewu='brew upgrade' alias brewU='brew update && brew upgrade' alias brewx='brew remove' +# Homebrew Cask +alias cask='brew cask' +alias caskc='brew cask cleanup --outdated' +alias caskC='brew cask cleanup' +alias caski='brew cask install' +alias caskl='brew cask list' +alias casks='brew cask search' +alias caskx='brew cask uninstall' diff --git a/modules/macports/README.md b/modules/macports/README.md index 9145d489a9..97f67ea00b 100644 --- a/modules/macports/README.md +++ b/modules/macports/README.md @@ -23,4 +23,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/macports/init.zsh b/modules/macports/init.zsh index 5698114855..d55744a875 100644 --- a/modules/macports/init.zsh +++ b/modules/macports/init.zsh @@ -32,4 +32,3 @@ alias portU='sudo port selfupdate && sudo port upgrade outdated' alias portu='sudo port upgrade' alias portX='sudo port -u uninstall' alias portx='sudo port uninstall' - diff --git a/modules/node/README.md b/modules/node/README.md index c0174ebbea..5f0c3caf73 100644 --- a/modules/node/README.md +++ b/modules/node/README.md @@ -43,4 +43,3 @@ Authors [3]: http://nodejs.org/api [4]: https://github.com/sorin-ionescu/prezto/issues [5]: https://github.com/creationix/nvm - diff --git a/modules/node/functions/node-doc b/modules/node/functions/node-doc index 155b131b07..24f5641422 100644 --- a/modules/node/functions/node-doc +++ b/modules/node/functions/node-doc @@ -5,6 +5,10 @@ # Sorin Ionescu # -# TODO: Make the sections easier to use. -open "http://nodejs.org/docs/$(node --version | sed 's/-.*//')/api/all.html#${1}" +if [[ -z "$BROWSER" ]]; then + print "$0: no web browser defined" >&2 + return 1 +fi +# TODO: Make the sections easier to use. +"$BROWSER" "http://nodejs.org/docs/$(node --version | sed 's/-.*//')/api/all.html#${1}" diff --git a/modules/node/functions/node-info b/modules/node/functions/node-info index 2af5042eb0..7742f904f2 100644 --- a/modules/node/functions/node-info +++ b/modules/node/functions/node-info @@ -17,9 +17,8 @@ if (( $+functions[nvm_version] )); then version="${$(nvm_version)#v}" fi -if [[ -n "$version" ]]; then +if [[ "$version" != (none|) ]]; then zstyle -s ':prezto:module:node:info:version' format 'version_format' zformat -f version_formatted "$version_format" "v:$version" node_info[version]="$version_formatted" fi - diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 904d24d931..6fedb3c87c 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -6,9 +6,13 @@ # Zeh Rizzatti # -# Load NVM into the shell session. +# Load manually installed NVM into the shell session. if [[ -s "$HOME/.nvm/nvm.sh" ]]; then source "$HOME/.nvm/nvm.sh" + +# Load package manager installed NVM into the shell session. +elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2>/dev/null)" ]]; then + source $(brew --prefix nvm)/nvm.sh fi # Return if requirements are not found. @@ -29,4 +33,3 @@ if (( $+commands[npm] )); then unset cache_file fi - diff --git a/modules/ocaml/README.md b/modules/ocaml/README.md index 7d56fec8a5..e1701586b0 100644 --- a/modules/ocaml/README.md +++ b/modules/ocaml/README.md @@ -1,15 +1,15 @@ -Ocaml +OCaml ===== -Initializes [Ocaml][1] package management. +Initializes [OCaml][1] package management. OPAM ---- -[OPAM][2] is a package manager for Ocaml. +[OPAM][2] is a package manager for OCaml. This module enables local package installation with OPAM by extending the -relevant path and Ocaml variables. +relevant path and OCaml variables. ### Usage @@ -25,4 +25,3 @@ Authors [1]: http://ocaml.org/ [2]: http://opam.ocamlpro.com/ [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/ocaml/init.zsh b/modules/ocaml/init.zsh index 2e5b71e552..b09c7eb283 100644 --- a/modules/ocaml/init.zsh +++ b/modules/ocaml/init.zsh @@ -1,15 +1,14 @@ # -# Initializes Ocaml package management. +# Initializes OCaml package management. # # Authors: # Sebastian Wiesner # # Return if requirements are not found. -if (( ! $+commands[opam] )); then +if [[ ! -f "$HOME/.opam/opam-init/init.zsh" ]]; then return 1 fi # Initialize OPAM. -eval "$(opam config env)" - +source "$HOME/.opam/opam-init/init.zsh" diff --git a/modules/osx/functions/_manb_mand_manp b/modules/osx/functions/_manb_mand_manp index ae5630f112..8ea1e5634b 100644 --- a/modules/osx/functions/_manb_mand_manp +++ b/modules/osx/functions/_manb_mand_manp @@ -9,4 +9,3 @@ # _man - diff --git a/modules/osx/functions/mand b/modules/osx/functions/mand index a22114e1a0..7a9653a1fa 100644 --- a/modules/osx/functions/mand +++ b/modules/osx/functions/mand @@ -18,4 +18,3 @@ function mand { } mand "$@" - diff --git a/modules/osx/functions/manp b/modules/osx/functions/manp index 7ecb1da280..fcb2a02669 100644 --- a/modules/osx/functions/manp +++ b/modules/osx/functions/manp @@ -17,4 +17,3 @@ function manp { } manp "$@" - diff --git a/modules/osx/functions/tab b/modules/osx/functions/tab index 9a71a04c2d..e95afbf5be 100644 --- a/modules/osx/functions/tab +++ b/modules/osx/functions/tab @@ -39,4 +39,3 @@ EOF end tell EOF } - diff --git a/modules/pacman/README.md b/modules/pacman/README.md index 10b47b0509..fb07407d69 100644 --- a/modules/pacman/README.md +++ b/modules/pacman/README.md @@ -63,4 +63,3 @@ Authors [1]: http://www.archlinux.org/pacman/ [2]: http://archlinux.fr/yaourt-en [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/pacman/functions/pacman-list-disowned b/modules/pacman/functions/pacman-list-disowned index d6b6f289b2..a097c9db99 100644 --- a/modules/pacman/functions/pacman-list-disowned +++ b/modules/pacman/functions/pacman-list-disowned @@ -20,4 +20,3 @@ find /bin /etc /lib /sbin /usr \ \( -type d -printf '%p/\n' -o -print \) | sort > "$fs" comm -23 "$fs" "$db" - diff --git a/modules/pacman/functions/pacman-list-explicit b/modules/pacman/functions/pacman-list-explicit index 7359bfedeb..2967834f11 100644 --- a/modules/pacman/functions/pacman-list-explicit +++ b/modules/pacman/functions/pacman-list-explicit @@ -18,4 +18,3 @@ pacman --query --explicit --info \ print $2 } ' - diff --git a/modules/pacman/init.zsh b/modules/pacman/init.zsh index 2b4f0a22e4..9d752a9b1d 100644 --- a/modules/pacman/init.zsh +++ b/modules/pacman/init.zsh @@ -72,7 +72,7 @@ alias pacman-remove-orphans="${_pacman_sudo}${_pacman_frontend} --remove --recur # Synchronizes the local package and Arch Build System databases against the # repositories. if (( $+commands[abs] )); then - alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh && ${_pacman_sudo}abs" + alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh && sudo abs" else alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh" fi @@ -82,4 +82,3 @@ fi alias pacU="${_pacman_sudo}${_pacman_frontend} --sync --refresh --sysupgrade" unset _pacman_{frontend,sudo} - diff --git a/modules/pacman/yaourt.zsh b/modules/pacman/yaourt.zsh index f4709e083e..819fad16be 100644 --- a/modules/pacman/yaourt.zsh +++ b/modules/pacman/yaourt.zsh @@ -16,4 +16,3 @@ fi # Manages .pac* files. alias pacc='yaourt -C' - diff --git a/modules/perl/README.md b/modules/perl/README.md index eabdc5cbab..90af1ebe4b 100644 --- a/modules/perl/README.md +++ b/modules/perl/README.md @@ -1,7 +1,7 @@ Perl ==== -Enables local [Perl][1] module installation on Mac OS X and defines alises. +Enables local [Perl][1] module installation on Mac OS X and defines aliases. Local Module Installation ------------------------- @@ -61,4 +61,3 @@ Authors [1]: http://www.perl.org [2]: http://perlbrew.pl [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 0997a4b2bf..a8d56031bd 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -50,4 +50,3 @@ alias plbO='perlbrew switch-off' alias plbs='perlbrew switch' alias plbu='perlbrew use' alias plbx='perlbrew uninstall' - diff --git a/modules/prompt/README.md b/modules/prompt/README.md index da3f2bac4c..d72c6cf625 100644 --- a/modules/prompt/README.md +++ b/modules/prompt/README.md @@ -109,4 +109,3 @@ Authors [1]: http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Prompt-Themes [2]: http://zsh.sourceforge.net/Doc/Release/Functions.html#Hook-Functions [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/prompt/functions/prompt_minimal_setup b/modules/prompt/functions/prompt_minimal_setup index a86c04e8c0..218efb2a91 100644 --- a/modules/prompt/functions/prompt_minimal_setup +++ b/modules/prompt/functions/prompt_minimal_setup @@ -48,4 +48,3 @@ function prompt_minimal_setup { } prompt_minimal_setup "$@" - diff --git a/modules/prompt/functions/prompt_nicoulaj_setup b/modules/prompt/functions/prompt_nicoulaj_setup index 9d20bd520c..241c8b6ea7 100644 --- a/modules/prompt/functions/prompt_nicoulaj_setup +++ b/modules/prompt/functions/prompt_nicoulaj_setup @@ -58,4 +58,3 @@ function prompt_nicoulaj_setup { } prompt_nicoulaj_setup "$@" - diff --git a/modules/prompt/functions/prompt_peepcode_setup b/modules/prompt/functions/prompt_peepcode_setup index 58f4f8b4dc..a83710efd1 100644 --- a/modules/prompt/functions/prompt_peepcode_setup +++ b/modules/prompt/functions/prompt_peepcode_setup @@ -85,4 +85,3 @@ function prompt_peepcode_preview { } prompt_peepcode_setup "$@" - diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index c3302ad1e4..c05fc42039 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -18,7 +18,7 @@ function prompt_sorin_pwd { _prompt_sorin_pwd="$MATCH" unset MATCH else - _prompt_sorin_pwd="${${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}%/}/${pwd:t}" + _prompt_sorin_pwd="${${${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}%/}//\%/%%}/${${pwd:t}//\%/%%}" fi } @@ -78,4 +78,3 @@ function prompt_sorin_setup { } prompt_sorin_setup "$@" - diff --git a/modules/prompt/functions/prompt_steeef_setup b/modules/prompt/functions/prompt_steeef_setup index f64f47d276..996331fd58 100644 --- a/modules/prompt/functions/prompt_steeef_setup +++ b/modules/prompt/functions/prompt_steeef_setup @@ -92,4 +92,3 @@ ${_prompt_steeef_colors[3]}%n%f at ${_prompt_steeef_colors[2]}%m%f in ${_prompt_ } prompt_steeef_setup "$@" - diff --git a/modules/prompt/init.zsh b/modules/prompt/init.zsh index de1b44bf0a..d976615a4d 100644 --- a/modules/prompt/init.zsh +++ b/modules/prompt/init.zsh @@ -16,4 +16,3 @@ else prompt 'off' fi unset prompt_argv - diff --git a/modules/python/README.md b/modules/python/README.md index 8e8c8f018b..d9497d6f5d 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -97,4 +97,3 @@ Authors [3]: http://pypi.python.org/pypi/virtualenv [4]: https://github.com/yyuu/pyenv [5]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/python/functions/python-info b/modules/python/functions/python-info index 634d01d0e1..6a8c758934 100644 --- a/modules/python/functions/python-info +++ b/modules/python/functions/python-info @@ -19,4 +19,3 @@ if [[ -n "$VIRTUAL_ENV" ]]; then zformat -f virtualenv_formatted "$virtualenv_format" "v:${VIRTUAL_ENV:t}" python_info[virtualenv]="$virtualenv_formatted" fi - diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 5715b02451..da78ea799a 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -35,14 +35,14 @@ if (( ! $+commands[python] && ! $+commands[pyenv] )); then fi # Load virtualenvwrapper into the shell session. -if (( $+commands[virtualenvwrapper_lazy.sh] )); then +if (( $+commands[virtualenvwrapper.sh] )); then # Set the directory where virtual environments are stored. export WORKON_HOME="$HOME/.virtualenvs" # Disable the virtualenv prompt. VIRTUAL_ENV_DISABLE_PROMPT=1 - source "$commands[virtualenvwrapper_lazy.sh]" + source "$commands[virtualenvwrapper.sh]" fi # @@ -50,4 +50,3 @@ fi # alias py='python' - diff --git a/modules/rails/README.md b/modules/rails/README.md index 239a1d1848..19bea1d800 100644 --- a/modules/rails/README.md +++ b/modules/rails/README.md @@ -32,4 +32,3 @@ Authors [1]: http://rubyonrails.org [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/rails/init.zsh b/modules/rails/init.zsh index 70f50ce8ea..44b53e90a0 100644 --- a/modules/rails/init.zsh +++ b/modules/rails/init.zsh @@ -33,4 +33,3 @@ alias rorr='bundle exec rails runner' alias rors='bundle exec rails server' alias rorsd='bundle exec rails server --debugger' alias rorx='bundle exec rails destroy' - diff --git a/modules/rsync/README.md b/modules/rsync/README.md index a2b62c4f5a..951e3c6ad5 100644 --- a/modules/rsync/README.md +++ b/modules/rsync/README.md @@ -25,4 +25,3 @@ Authors [1]: http://rsync.samba.org [2]: http://help.bombich.com/kb/overview/credits#opensource [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index afb9192ab7..3afebdb4dd 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -16,10 +16,14 @@ fi _rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' +if grep -q 'xattrs' <(rsync --help 2>&1); then + _rsync_cmd="${_rsync_cmd} --acls --xattrs" +fi + # Mac OS X and HFS+ Enhancements # http://help.bombich.com/kb/overview/credits#opensource if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then - _rsync_cmd="${_rsync_cmd} --crtimes --acls --xattrs --fileflags --protect-decmpfs --force-change" + _rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change" fi alias rsync-copy="${_rsync_cmd}" @@ -28,4 +32,3 @@ alias rsync-update="${_rsync_cmd} --update" alias rsync-synchronize="${_rsync_cmd} --update --delete" unset _rsync_cmd - diff --git a/modules/ruby/functions/ruby-app-root b/modules/ruby/functions/ruby-app-root index cff8966fc4..ea35be6059 100644 --- a/modules/ruby/functions/ruby-app-root +++ b/modules/ruby/functions/ruby-app-root @@ -16,4 +16,3 @@ while [[ "$root_dir" != '/' ]]; do done return 1 - diff --git a/modules/ruby/functions/ruby-info b/modules/ruby/functions/ruby-info index b3656dd85e..ebf0f7fe8d 100644 --- a/modules/ruby/functions/ruby-info +++ b/modules/ruby/functions/ruby-info @@ -28,4 +28,3 @@ if [[ -n "$version" ]]; then zformat -f version_formatted "$version_format" "v:$version" ruby_info[version]="$version_formatted" fi - diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index eb18dd3715..174d1858a3 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -63,4 +63,3 @@ if (( $+commands[bundle] )); then && print vendor/bundle >>! .gitignore \ && print vendor/cache >>! .gitignore' fi - diff --git a/modules/screen/README.md b/modules/screen/README.md index 8e93fe2d35..ef96404920 100644 --- a/modules/screen/README.md +++ b/modules/screen/README.md @@ -38,4 +38,3 @@ Authors [1]: http://www.gnu.org/software/screen/ [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index 7a5cee3ded..0dee1c96d6 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -40,4 +40,3 @@ alias scr='screen' alias scrl='screen -list' alias scrn='screen -U -S' alias scrr='screen -a -A -U -D -R' - diff --git a/modules/spectrum/README.md b/modules/spectrum/README.md index 2865a70e07..66abcb2679 100644 --- a/modules/spectrum/README.md +++ b/modules/spectrum/README.md @@ -3,7 +3,7 @@ Spectrum Provides for easier use of 256 colors and effects. -To learn more about text formatting, read [That 256 Color Thing][1]. +To learn more about text formatting, read [A Guide to 256 Color Codes][1]. Variables --------- @@ -87,6 +87,5 @@ Authors - [P.C. Shyamshankar](https://github.com/sykora) - [Sorin Ionescu](https://github.com/sorin-ionescu) -[1]: http://lucentbeing.com/blog/that-256-color-thing/ +[1]: http://lucentbeing.com/writing/archives/a-guide-to-256-color-codes/ [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/spectrum/init.zsh b/modules/spectrum/init.zsh index 86b5ecc665..61e2262ff6 100644 --- a/modules/spectrum/init.zsh +++ b/modules/spectrum/init.zsh @@ -67,4 +67,3 @@ for color in {0..255}; do BG[$color]="\e[48;5;${color}m" done unset color{s,} index - diff --git a/modules/ssh/README.md b/modules/ssh/README.md index e953a60193..45bd2bd275 100644 --- a/modules/ssh/README.md +++ b/modules/ssh/README.md @@ -25,4 +25,3 @@ Authors [1]: http://www.openssh.com [2]: http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-agent&sektion=1 [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index 608e34e628..d8b593771e 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -25,7 +25,7 @@ if [[ ! -S "$SSH_AUTH_SOCK" ]]; then source "$_ssh_agent_env" 2> /dev/null # Start ssh-agent if not started. - if ! ps -U "$USER" -o pid,ucomm | grep -q "${SSH_AGENT_PID} ssh-agent"; then + if ! ps -U "$USER" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then eval "$(ssh-agent | sed '/^echo /d' | tee "$_ssh_agent_env")" fi fi @@ -48,4 +48,3 @@ fi # Clean up. unset _ssh_{dir,identities} _ssh_agent_{env,sock} - diff --git a/modules/syntax-highlighting/README.md b/modules/syntax-highlighting/README.md index c88c54cfec..87f85bea99 100644 --- a/modules/syntax-highlighting/README.md +++ b/modules/syntax-highlighting/README.md @@ -27,7 +27,7 @@ To enable highlighting for this module only, add the following line to ### Highlighters Syntax highlighting is accomplished by pluggable [highlighters][2]. This module -enables the *main*, *brackets*, and *cursor* highlighters by default. +only enables the *main* highlighter by default. To enable all highlighters, add the following to *zpreztorc*: @@ -60,4 +60,3 @@ Authors [1]: https://github.com/zsh-users/zsh-syntax-highlighting [2]: https://github.com/zsh-users/zsh-syntax-highlighting/tree/master/highlighters [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/syntax-highlighting/init.zsh b/modules/syntax-highlighting/init.zsh index 55172b8992..25cd96b674 100644 --- a/modules/syntax-highlighting/init.zsh +++ b/modules/syntax-highlighting/init.zsh @@ -26,4 +26,3 @@ for syntax_highlighting_style in "${(k)syntax_highlighting_styles[@]}"; do ZSH_HIGHLIGHT_STYLES[$syntax_highlighting_style]="$syntax_highlighting_styles[$syntax_highlighting_style]" done unset syntax_highlighting_style{s,} - diff --git a/modules/terminal/README.md b/modules/terminal/README.md index 435d97205e..58f81be1df 100644 --- a/modules/terminal/README.md +++ b/modules/terminal/README.md @@ -42,4 +42,3 @@ Authors [1]: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Expansion-of-Prompt-Sequences [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/terminal/init.zsh b/modules/terminal/init.zsh index e35b77dbe5..01140d8c71 100644 --- a/modules/terminal/init.zsh +++ b/modules/terminal/init.zsh @@ -78,11 +78,6 @@ function _terminal-set-titles-with-path { set-tab-title "$truncated_path" } -# Sets the Terminal.app proxy icon. -function _terminal-set-terminal-app-proxy-icon { - printf '\e]7;%s\a' "file://$HOST${${1:-$PWD}// /%20}" -} - # Do not override precmd/preexec; append to the hook array. autoload -Uz add-zsh-hook @@ -91,34 +86,36 @@ if [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] \ && ( ! [[ -n "$STY" || -n "$TMUX" || -n "$DVTM" ]] ) then # Sets the Terminal.app current working directory before the prompt is - # displayed. + # displayed. + function _terminal-set-terminal-app-proxy-icon { + printf '\e]7;%s\a' "file://${HOST}${PWD// /%20}" + } add-zsh-hook precmd _terminal-set-terminal-app-proxy-icon - # Unsets the Terminal.app current working directory when a terminal - # multiplexer or remote connection is started since it can no longer be + # Unsets the Terminal.app current working directory when a terminal + # multiplexer or remote connection is started since it can no longer be # updated, and it becomes confusing when the directory displayed in the title # bar is no longer synchronized with real current working directory. - function _terminal-unset-terminal-app-proxy-icon { + function _terminal-unset-terminal-app-proxy-icon { if [[ "${2[(w)1]:t}" == (screen|tmux|dvtm|ssh|mosh) ]]; then - _terminal-set-terminal-app-proxy-icon ' ' + print '\e]7;\a' fi - } - add-zsh-hook preexec _terminal-unset-terminal-app-proxy-icon + } + add-zsh-hook preexec _terminal-unset-terminal-app-proxy-icon # Do not set the tab and window titles in Terminal.app since it sets the tab # title to the currently running process by default and the current working # directory is set separately. - return + return fi # Set up non-Apple terminals. if zstyle -t ':prezto:module:terminal' auto-title \ && ( ! [[ -n "$STY" || -n "$TMUX" ]] ) then - # Sets the tab and window titles before the prompt is displayed. - add-zsh-hook precmd _terminal-set-titles-with-path + # Sets the tab and window titles before the prompt is displayed. + add-zsh-hook precmd _terminal-set-titles-with-path - # Sets the tab and window titles before command execution. - add-zsh-hook preexec _terminal-set-titles-with-command + # Sets the tab and window titles before command execution. + add-zsh-hook preexec _terminal-set-titles-with-command fi - diff --git a/modules/tmux/README.md b/modules/tmux/README.md index 0e2f652f1d..9a15be0973 100644 --- a/modules/tmux/README.md +++ b/modules/tmux/README.md @@ -64,4 +64,3 @@ Authors [3]: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard [4]: https://github.com/mxcl/homebrew [5]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/utility/README.md b/modules/utility/README.md index 6871be5457..5e7919ea1a 100644 --- a/modules/utility/README.md +++ b/modules/utility/README.md @@ -156,4 +156,3 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/utility/functions/_cdls_popdls_pushdls b/modules/utility/functions/_cdls_popdls_pushdls index 58f7cce0c2..5f0fe607f8 100644 --- a/modules/utility/functions/_cdls_popdls_pushdls +++ b/modules/utility/functions/_cdls_popdls_pushdls @@ -9,4 +9,3 @@ # _cd - diff --git a/modules/utility/functions/_dut b/modules/utility/functions/_dut index 9791f303f6..180dde70b3 100644 --- a/modules/utility/functions/_dut +++ b/modules/utility/functions/_dut @@ -9,4 +9,3 @@ # _du - diff --git a/modules/utility/functions/_mkdcd b/modules/utility/functions/_mkdcd index 5b20ee2305..5273651c59 100644 --- a/modules/utility/functions/_mkdcd +++ b/modules/utility/functions/_mkdcd @@ -11,4 +11,3 @@ local expl _wanted directories expl 'directory' _path_files -/ || _message 'directory' - diff --git a/modules/utility/functions/_prep b/modules/utility/functions/_prep index 8ecc7fd7b3..c9d6eda65b 100644 --- a/modules/utility/functions/_prep +++ b/modules/utility/functions/_prep @@ -16,4 +16,3 @@ _arguments \ '-x[ignore whitespace and comments]' \ '1::pattern:' \ '2::files:_files' && return 0 - diff --git a/modules/utility/functions/_psub b/modules/utility/functions/_psub index cd8bcfe78f..c79899e792 100644 --- a/modules/utility/functions/_psub +++ b/modules/utility/functions/_psub @@ -17,4 +17,3 @@ _arguments \ '1::pattern:' \ '2::replacement:' \ '3::files:_files' && return 0 - diff --git a/modules/utility/functions/diff b/modules/utility/functions/diff index e749c23207..8347899e2d 100644 --- a/modules/utility/functions/diff +++ b/modules/utility/functions/diff @@ -20,4 +20,3 @@ function diff { } diff "$@" - diff --git a/modules/utility/functions/dut b/modules/utility/functions/dut index e33f6d7f7f..659228052a 100644 --- a/modules/utility/functions/dut +++ b/modules/utility/functions/dut @@ -25,4 +25,3 @@ function dut { } dut "$@" - diff --git a/modules/utility/functions/make b/modules/utility/functions/make index a222573131..5ebab05715 100644 --- a/modules/utility/functions/make +++ b/modules/utility/functions/make @@ -18,4 +18,3 @@ function make { } make "$@" - diff --git a/modules/utility/functions/prep b/modules/utility/functions/prep index c61487bb03..23028ec436 100644 --- a/modules/utility/functions/prep +++ b/modules/utility/functions/prep @@ -50,4 +50,3 @@ pattern="$1" shift perl -n -l -e "print if ${invert:+not} m/${pattern//\//\\/}/${modifiers}" "$@" - diff --git a/modules/utility/functions/psub b/modules/utility/functions/psub index 4f2c06e3cf..ffc01088f8 100644 --- a/modules/utility/functions/psub +++ b/modules/utility/functions/psub @@ -51,4 +51,3 @@ replacement="$2" repeat 2 shift perl -i'.orig' -n -l -e "s/${pattern//\//\\/}/${replacement//\//\\/}/${modifiers}; print" "$@" - diff --git a/modules/utility/functions/wdiff b/modules/utility/functions/wdiff index 1855cb33a2..c93ead1c6d 100644 --- a/modules/utility/functions/wdiff +++ b/modules/utility/functions/wdiff @@ -27,4 +27,3 @@ function wdiff { } wdiff "$@" - diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 2c34a74d85..102ae5a1b9 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -66,9 +66,9 @@ if is-callable 'dircolors'; then if zstyle -t ':prezto:module:utility:ls' color; then if [[ -s "$HOME/.dir_colors" ]]; then - eval "$(dircolors "$HOME/.dir_colors")" + eval "$(dircolors --sh "$HOME/.dir_colors")" else - eval "$(dircolors)" + eval "$(dircolors --sh)" fi alias ls="$aliases[ls] --color=auto" @@ -185,4 +185,3 @@ function find-exec { function psu { ps -U "${1:-$USER}" -o 'pid,%cpu,%mem,command' "${(@)argv[2,-1]}" } - diff --git a/modules/wakeonlan/README.md b/modules/wakeonlan/README.md index 54fc683cba..9bde199ecc 100644 --- a/modules/wakeonlan/README.md +++ b/modules/wakeonlan/README.md @@ -34,4 +34,3 @@ Authors [1]: http://gsd.di.uminho.pt/jpo/software/wakeonlan/ [2]: http://man.cx/wakeonlan [3]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/wakeonlan/functions/_wake b/modules/wakeonlan/functions/_wake index 85aee5a164..87e1a363c7 100644 --- a/modules/wakeonlan/functions/_wake +++ b/modules/wakeonlan/functions/_wake @@ -10,4 +10,3 @@ # _arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0 - diff --git a/modules/wakeonlan/functions/wake b/modules/wakeonlan/functions/wake index b8a6ab5db5..5259c95b78 100644 --- a/modules/wakeonlan/functions/wake +++ b/modules/wakeonlan/functions/wake @@ -18,4 +18,3 @@ if (( ! $+commands[wakeonlan] )); then fi wakeonlan -f "$config_file" - diff --git a/modules/yum/README.md b/modules/yum/README.md index 9743c8720c..10383c56b4 100644 --- a/modules/yum/README.md +++ b/modules/yum/README.md @@ -26,4 +26,3 @@ Authors [1]: http://yum.baseurl.org [2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/modules/yum/init.zsh b/modules/yum/init.zsh index d7019cd060..2f5427d5e6 100644 --- a/modules/yum/init.zsh +++ b/modules/yum/init.zsh @@ -25,4 +25,3 @@ alias yumr='sudo yum remove' # Removes package(s). alias yums='yum search' # Searches for a package. alias yumu='sudo yum update' # Updates packages. alias yumU='sudo yum upgrade' # Upgrades packages. - diff --git a/runcoms/README.md b/runcoms/README.md index 97824d8c01..9df890e51a 100644 --- a/runcoms/README.md +++ b/runcoms/README.md @@ -77,4 +77,3 @@ Authors [2]: http://en.wikipedia.org/wiki/Fortune_(Unix) [3]: http://www.manpagez.com/man/1/msgs [4]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/runcoms/zlogin b/runcoms/zlogin index 1bc81d0200..fc7021e910 100644 --- a/runcoms/zlogin +++ b/runcoms/zlogin @@ -16,8 +16,10 @@ # Print a random, hopefully interesting, adage. if (( $+commands[fortune] )); then - fortune -a - print + if [[ -t 0 || -t 1 ]]; then + fortune -a + print + fi fi diff --git a/runcoms/zlogout b/runcoms/zlogout index d898fec1aa..7c27e88581 100644 --- a/runcoms/zlogout +++ b/runcoms/zlogout @@ -11,4 +11,3 @@ cat <<-EOF Thank you. Come again! -- Dr. Apu Nahasapeemapetilon EOF - diff --git a/runcoms/zprofile b/runcoms/zprofile index 7118770cde..08d39be1db 100644 --- a/runcoms/zprofile +++ b/runcoms/zprofile @@ -57,8 +57,9 @@ path=( export LESS='-F -g -i -M -R -S -w -X -z-4' # Set the Less input preprocessor. -if (( $+commands[lesspipe.sh] )); then - export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' +# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. +if (( $#commands[(i)lesspipe(|.sh)] )); then + export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" fi # @@ -74,4 +75,3 @@ TMPPREFIX="${TMPDIR%/}/zsh" if [[ ! -d "$TMPPREFIX" ]]; then mkdir -p "$TMPPREFIX" fi - diff --git a/runcoms/zshenv b/runcoms/zshenv index 2b13503a62..2d97203180 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -9,4 +9,3 @@ if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then source "${ZDOTDIR:-$HOME}/.zprofile" fi -