1
0
Fork 0

Merge pull request #1 from sorin-ionescu/master

Update
pull/1006/head
Bruce Hernandez 10 years ago
commit eb3a1c9d76

@ -86,7 +86,8 @@ License
(The MIT License) (The MIT License)
Copyright (c) 2009-2011 Robby Russell and contributors. Copyright (c) 2009-2011 Robby Russell and contributors.
Copyright (c) 2011-2014 Sorin Ionescu and contributors.
Copyright (c) 2011-2015 Sorin Ionescu and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in
@ -107,7 +108,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
[1]: http://www.zsh.org [1]: http://www.zsh.org
[2]: http://i.imgur.com/AzjmpwM.png "sorin theme" [2]: http://i.imgur.com/nrGV6pg.png "sorin theme"
[3]: http://git-scm.com [3]: http://git-scm.com
[4]: https://github.com [4]: https://github.com
[5]: http://gitimmersion.com [5]: http://gitimmersion.com

@ -26,6 +26,11 @@ Directory
Sets directory options and defines directory aliases. Sets directory options and defines directory aliases.
DNF
---
Defines dnf aliases.
Dpkg Dpkg
---- ----
@ -92,7 +97,7 @@ Homebrew
Defines Homebrew aliases. Defines Homebrew aliases.
Macports MacPorts
-------- --------
Defines MacPorts aliases and adds MacPorts directories to path variables. Defines MacPorts aliases and adds MacPorts directories to path variables.

@ -1 +1 @@
Subproject commit ed964013e290677c866a055e1c1ece6f33f64151 Subproject commit 68c949470eaa87c5d67080d32fb2b69c8b837eb4

@ -24,7 +24,7 @@ autoload -Uz compinit && compinit -i
setopt COMPLETE_IN_WORD # Complete from both ends of a word. setopt COMPLETE_IN_WORD # Complete from both ends of a word.
setopt ALWAYS_TO_END # Move cursor to the end of a completed word. setopt ALWAYS_TO_END # Move cursor to the end of a completed word.
setopt PATH_DIRS # Perform path search even on command names with slashes. setopt PATH_DIRS # Perform path search even on command names with slashes.
setopt AUTO_MENU # Show completion menu on a succesive tab press. setopt AUTO_MENU # Show completion menu on a successive tab press.
setopt AUTO_LIST # Automatically list choices on ambiguous completion. setopt AUTO_LIST # Automatically list choices on ambiguous completion.
setopt AUTO_PARAM_SLASH # If completed parameter is a directory, add a trailing slash. setopt AUTO_PARAM_SLASH # If completed parameter is a directory, add a trailing slash.
unsetopt MENU_COMPLETE # Do not autoselect the first completion entry. unsetopt MENU_COMPLETE # Do not autoselect the first completion entry.
@ -34,7 +34,7 @@ unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor.
# Styles # Styles
# #
# Use caching to make completion for cammands such as dpkg and apt usable. # Use caching to make completion for commands such as dpkg and apt usable.
zstyle ':completion::complete:*' use-cache on zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache" zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache"

@ -0,0 +1,29 @@
DNF
===
Defines [dnf][1] aliases.
Aliases
-------
- `dnfc` removes package(s) and leaves.
- `dnfi` installs package(s).
- `dnfh` displays history.
- `dnfl` lists packages.
- `dnfL` lists installed packages.
- `dnfq` displays package information.
- `dnfr` removes package(s).
- `dnfs` searches for a package.
- `dnfu` updates packages.
- `dnfU` upgrates packages.
Authors
-------
*The authors of this module should be contacted via the [issue tracker][2].*
- [Sorin Ionescu](https://github.com/sorin-ionescu)
[1]: https://fedoraproject.org/wiki/Features/DNF
[2]: https://github.com/sorin-ionescu/prezto/issues

@ -0,0 +1,28 @@
#
# Defines dnf aliases.
#
# Authors:
# FireWave <firewave@free.fr>
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Return if requirements are not found.
if (( ! $+commands[dnf] )); then
return 1
fi
#
# Aliases
#
alias dnfc='sudo dnf clean all' # Cleans the cache.
alias dnfh='dnf history' # Displays history.
alias dnfi='sudo dnf install' # Installs package(s).
alias dnfl='dnf list' # Lists packages.
alias dnfL='dnf list installed' # Lists installed packages.
alias dnfq='dnf info' # Displays package information.
alias dnfr='sudo dnf remove' # Removes package(s).
alias dnfs='dnf search' # Searches for a package.
alias dnfu='sudo dnf update' # Updates packages.
alias dnfU='sudo dnf upgrade' # Upgrades packages.

@ -1 +1 @@
Subproject commit 9f9fc7d550cc547737f4c686591cbbf07e7470b0 Subproject commit c4a83561a12b898ff7145856d0e6ae50757e28ba

@ -13,8 +13,7 @@ Aliases
- `brewi` installs a formula. - `brewi` installs a formula.
- `brewl` lists installed formulae. - `brewl` lists installed formulae.
- `brews` searches for a formula. - `brews` searches for a formula.
- `brewU` upgrades Homebrew and outdated brews. - `brewu` updates Homebrew and formulae.
- `brewu` upgrades Homebrew.
- `brewx` uninstalls a formula. - `brewx` uninstalls a formula.
### Homebrew Cask ### Homebrew Cask

@ -6,7 +6,7 @@
# #
# Return if requirements are not found. # Return if requirements are not found.
if [[ "$OSTYPE" != darwin* ]]; then if [[ "$OSTYPE" != (darwin|linux)* ]]; then
return 1 return 1
fi fi
@ -20,8 +20,7 @@ alias brewC='brew cleanup --force'
alias brewi='brew install' alias brewi='brew install'
alias brewl='brew list' alias brewl='brew list'
alias brews='brew search' alias brews='brew search'
alias brewu='brew upgrade' alias brewu='brew update && brew upgrade --all'
alias brewU='brew update && brew upgrade'
alias brewx='brew remove' alias brewx='brew remove'
# Homebrew Cask # Homebrew Cask

@ -1,4 +1,4 @@
Macports MacPorts
======== ========
Defines MacPorts aliases and adds MacPorts directories to path variables. Defines MacPorts aliases and adds MacPorts directories to path variables.

@ -1 +1 @@
Subproject commit e5a55c5469b82da5bd9a9e42b144cef7cec8915b Subproject commit 04212522f39f43998d001b4a94b05856f010a54b

@ -0,0 +1 @@
../external/pure/async.zsh

@ -5,7 +5,28 @@
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# #
# Screenshots: # Screenshots:
# http://i.imgur.com/AzjmpwM.png # http://i.imgur.com/nrGV6pg.png
#
#
# 16 Terminal Colors
# -- ---------------
# 0 black
# 1 red
# 2 green
# 3 yellow
# 4 blue
# 5 magenta
# 6 cyan
# 7 white
# 8 bright black
# 9 bright red
# 10 bright green
# 11 bright yellow
# 12 bright blue
# 13 bright magenta
# 14 bright cyan
# 15 bright white
# #
# Load dependencies. # Load dependencies.
@ -22,6 +43,33 @@ function prompt_sorin_pwd {
fi fi
} }
function prompt_sorin_git_info {
# Append Git status.
if [[ -s "$_prompt_sorin_precmd_async_data" ]]; then
alias typeset='typeset -g'
source "$_prompt_sorin_precmd_async_data"
RPROMPT+='${git_info:+${(e)git_info[status]}}'
unalias typeset
fi
# Reset PID.
_prompt_sorin_precmd_async_pid=0
# Redisplay prompt.
zle && zle reset-prompt
}
function prompt_sorin_precmd_async {
# Get Git repository information.
if (( $+functions[git-info] )); then
git-info
typeset -p git_info >! "$_prompt_sorin_precmd_async_data"
fi
# Signal completion to parent process.
kill -USR1 $$
}
function prompt_sorin_precmd { function prompt_sorin_precmd {
setopt LOCAL_OPTIONS setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS unsetopt XTRACE KSH_ARRAYS
@ -29,16 +77,26 @@ function prompt_sorin_precmd {
# Format PWD. # Format PWD.
prompt_sorin_pwd prompt_sorin_pwd
# Get Git repository information. # Define prompts.
if (( $+functions[git-info] )); then RPROMPT='${editor_info[overwrite]}%(?:: %F{1}⏎%f)${VIM:+" %B%F{6}V%f%b"}'
git-info
# Kill the old process of slow commands if it is still running.
if (( _prompt_sorin_precmd_async_pid > 0 )); then
kill -TERM "$_prompt_sorin_precmd_async_pid" &>/dev/null
fi fi
# Compute slow commands in the background.
trap prompt_sorin_git_info USR1
prompt_sorin_precmd_async &!
_prompt_sorin_precmd_async_pid=$!
} }
function prompt_sorin_setup { function prompt_sorin_setup {
setopt LOCAL_OPTIONS setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS unsetopt XTRACE KSH_ARRAYS
prompt_opts=(cr percent subst) prompt_opts=(cr percent subst)
_prompt_sorin_precmd_async_pid=0
_prompt_sorin_precmd_async_data="${TMPPREFIX}-prompt_sorin_data"
# Load required functions. # Load required functions.
autoload -Uz add-zsh-hook autoload -Uz add-zsh-hook
@ -47,34 +105,33 @@ function prompt_sorin_setup {
add-zsh-hook precmd prompt_sorin_precmd add-zsh-hook precmd prompt_sorin_precmd
# Set editor-info parameters. # Set editor-info parameters.
zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' zstyle ':prezto:module:editor:info:completing' format '%B%F{7}...%f%b'
zstyle ':prezto:module:editor:info:keymap:primary' format ' %B%F{red}%F{yellow}%F{green}%f%b' zstyle ':prezto:module:editor:info:keymap:primary' format ' %B%F{1}%F{3}%F{2}%f%b'
zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format ' %F{red}♺%f' zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format ' %F{3}♺%f'
zstyle ':prezto:module:editor:info:keymap:alternate' format ' %B%F{green}%F{yellow}%F{red}%f%b' zstyle ':prezto:module:editor:info:keymap:alternate' format ' %B%F{2}%F{3}%F{1}%f%b'
# Set git-info parameters. # Set git-info parameters.
zstyle ':prezto:module:git:info' verbose 'yes' zstyle ':prezto:module:git:info' verbose 'yes'
zstyle ':prezto:module:git:info:action' format ':%%B%F{yellow}%s%f%%b' zstyle ':prezto:module:git:info:action' format '%F{7}:%f%%B%F{9}%s%f%%b'
zstyle ':prezto:module:git:info:added' format ' %%B%F{green}✚%f%%b' zstyle ':prezto:module:git:info:added' format ' %%B%F{2}✚%f%%b'
zstyle ':prezto:module:git:info:ahead' format ' %%B%F{yellow}⬆%f%%b' zstyle ':prezto:module:git:info:ahead' format ' %%B%F{13}⬆%f%%b'
zstyle ':prezto:module:git:info:behind' format ' %%B%F{yellow}⬇%f%%b' zstyle ':prezto:module:git:info:behind' format ' %%B%F{13}⬇%f%%b'
zstyle ':prezto:module:git:info:branch' format ':%F{green}%b%f' zstyle ':prezto:module:git:info:branch' format ' %%B%F{2}%b%f%%b'
zstyle ':prezto:module:git:info:commit' format ':%F{green}%.7c%f' zstyle ':prezto:module:git:info:commit' format ' %%B%F{3}%.7c%f%%b'
zstyle ':prezto:module:git:info:deleted' format ' %%B%F{red}✖%f%%b' zstyle ':prezto:module:git:info:deleted' format ' %%B%F{1}✖%f%%b'
zstyle ':prezto:module:git:info:modified' format ' %%B%F{blue}✱%f%%b' zstyle ':prezto:module:git:info:modified' format ' %%B%F{4}✱%f%%b'
zstyle ':prezto:module:git:info:position' format ':%F{red}%p%f' zstyle ':prezto:module:git:info:position' format ' %%B%F{13}%p%f%%b'
zstyle ':prezto:module:git:info:renamed' format ' %%B%F{magenta}➜%f%%b' zstyle ':prezto:module:git:info:renamed' format ' %%B%F{5}➜%f%%b'
zstyle ':prezto:module:git:info:stashed' format ' %%B%F{cyan}✭%f%%b' zstyle ':prezto:module:git:info:stashed' format ' %%B%F{6}✭%f%%b'
zstyle ':prezto:module:git:info:unmerged' format ' %%B%F{yellow}═%f%%b' zstyle ':prezto:module:git:info:unmerged' format ' %%B%F{3}═%f%%b'
zstyle ':prezto:module:git:info:untracked' format ' %%B%F{white}◼%f%%b' zstyle ':prezto:module:git:info:untracked' format ' %%B%F{7}◼%f%%b'
zstyle ':prezto:module:git:info:keys' format \ zstyle ':prezto:module:git:info:keys' format \
'prompt' ' %F{blue}git%f$(coalesce "%b" "%p" "%c")%s' \ 'status' '$(coalesce "%b" "%p" "%c")%s%A%B%S%a%d%m%r%U%u'
'rprompt' '%A%B%S%a%d%m%r%U%u'
# Define prompts. # Define prompts.
PROMPT='${SSH_TTY:+"%F{red}%n%f@%F{yellow}%m%f "}%F{cyan}${_prompt_sorin_pwd}%f${git_info:+${(e)git_info[prompt]}}%(!. %B%F{red}#%f%b.)${editor_info[keymap]} ' PROMPT='${SSH_TTY:+"%F{9}%n%f%F{7}@%f%F{3}%m%f "}%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} '
RPROMPT='${editor_info[overwrite]}%(?:: %F{red}⏎%f)${VIM:+" %B%F{green}V%f%b"}${INSIDE_EMACS:+" %B%F{green}E%f%b"}${git_info[rprompt]}' RPROMPT=''
SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' SPROMPT='zsh: correct %F{1}%R%f to %F{2}%r%f [nyae]? '
} }
prompt_sorin_setup "$@" prompt_sorin_setup "$@"

@ -6,7 +6,7 @@
# #
# Return if requirements are not found. # Return if requirements are not found.
if [[ "$TERM" == (dumb|linux|*bsd*) ]]; then if [[ "$TERM" == (dumb|linux|*bsd*|eterm*) ]]; then
return 1 return 1
fi fi

@ -74,4 +74,4 @@ Authors
[4]: https://github.com/mxcl/homebrew [4]: https://github.com/mxcl/homebrew
[5]: https://github.com/sorin-ionescu/prezto/issues [5]: https://github.com/sorin-ionescu/prezto/issues
[6]: http://iterm2.com [6]: http://iterm2.com
[7]: https://code.google.com/p/iterm2/wiki/TmuxIntegration [7]: https://gitlab.com/gnachman/iterm2/wikis/TmuxIntegration

@ -71,9 +71,9 @@ if is-callable 'dircolors'; then
eval "$(dircolors --sh)" eval "$(dircolors --sh)"
fi fi
alias ls="$aliases[ls] --color=auto" alias ls="${aliases[ls]:-ls} --color=auto"
else else
alias ls="$aliases[ls] -F" alias ls="${aliases[ls]:-ls} -F"
fi fi
else else
# BSD Core Utilities # BSD Core Utilities
@ -84,9 +84,9 @@ else
# Define colors for the completion system. # Define colors for the completion system.
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:' export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'
alias ls='ls -G' alias ls="${aliases[ls]:-ls} -G"
else else
alias ls='ls -F' alias ls="${aliases[ls]:-ls} -F"
fi fi
fi fi
@ -107,7 +107,7 @@ if zstyle -t ':prezto:module:utility:grep' color; then
export GREP_COLOR='37;45' # BSD. export GREP_COLOR='37;45' # BSD.
export GREP_COLORS="mt=$GREP_COLOR" # GNU. export GREP_COLORS="mt=$GREP_COLOR" # GNU.
alias grep="$aliases[grep] --color=auto" alias grep="${aliases[grep]:-grep} --color=auto"
fi fi
# Mac OS X Everywhere # Mac OS X Everywhere

Loading…
Cancel
Save