1
0
Fork 0

Merge remote-tracking branch 'upstream/master'

* upstream/master:
  Simplify a conditional
  Remove duplicate alias definitions
  Add utility aliases for Cygwin
  Replace pythonz with pyenv
  Update external syntax-highlighting
  Update external history-substring-search
  Update external completions
  Clarify customization instructions
  Move from Carton to Cask
  Increase control over multiplexer auto-start
  [Fix #459] Correct typos in the dpkg module
  [Fix #452] Squash bugs introduced in fcab2a1
  [Fix #411] Add Homebrew module
  [Fix #434] Correct ambiguity in the use of the term keymap
pull/666/head
Chauncey Garrett 11 years ago
commit f7fc26713f

@ -63,9 +63,10 @@ accompanying README files to learn of what is available.
Customization Customization
------------- -------------
The project is managed via [Git][3]. It is highly recommend that you commit The project is managed via [Git][3]. It is highly recommended that you fork this
your changes and push them to [GitHub][4] to not lose them. If you do not know project; so, that you can commit your changes and push them to [GitHub][4] to
how to use Git, follow this [tutorial][5] and bookmark this [reference][6]. not lose them. If you do not know how to use Git, follow this [tutorial][5] and
bookmark this [reference][6].
Resources Resources
--------- ---------

@ -71,6 +71,11 @@ History
Sets history options and defines history aliases. Sets history options and defines history aliases.
Homebrew
--------
Defines Homebrew aliases.
Macports Macports
-------- --------

@ -7,16 +7,16 @@ Aliases
------- -------
- `debc` cleans the cache. - `debc` cleans the cache.
- `debf` displays a file's packake. - `debf` displays a file's package.
- `debi` installs packages from repositories. - `debi` installs packages from repositories.
- `debI` installs packages from files. - `debI` installs packages from files.
- `debq` displays package information. - `debq` displays package information.
- `debu` updates the packages lists. - `debu` updates the package lists.
- `debU` upgrades outdated packages. - `debU` upgrades outdated packages.
- `debx` removes packages. - `debx` removes packages.
- `debX` removes packages, their configuration, and unneeded dependencies. - `debX` removes packages, their configuration, and unneeded dependencies.
- `debs` searches for packages. - `debs` searches for packages.
- `deb-build` creates a basic .deb package. - `deb-build` creates a basic deb package.
- `deb-kclean` removes all kernel images and headers, except for the ones in - `deb-kclean` removes all kernel images and headers, except for the ones in
use. use.

@ -19,7 +19,7 @@ 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'
# Displays a file's packake. # Displays a file's package.
alias debf='apt-file search --regexp' alias debf='apt-file search --regexp'
# Installs packages from repositories. # Installs packages from repositories.
@ -31,7 +31,7 @@ alias debI='sudo dpkg -i'
# Displays package information. # Displays package information.
alias debq='apt-cache show' alias debq='apt-cache show'
# Updates the packages lists. # Updates the package lists.
alias debu='sudo apt-get update' alias debu='sudo apt-get update'
# Upgrades outdated packages. # Upgrades outdated packages.
@ -50,7 +50,7 @@ else
alias debs='apt-cache search' alias debs='apt-cache search'
fi fi
# Creates a basic .deb package. # Creates a basic deb package.
alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc' alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc'
# Removes all kernel images and headers, except for the ones in use. # Removes all kernel images and headers, except for the ones in use.

@ -8,10 +8,10 @@ Settings
### Key bindings ### Key bindings
To enable key bindings, add the following to *zpreztorc*, and replace 'map' with To enable key bindings, add the following to *zpreztorc*, and replace 'bindings'
'emacs' or 'vi'. with 'emacs' or 'vi'.
zstyle ':prezto:module:editor' keymap 'map' zstyle ':prezto:module:editor' key-bindings 'bindings'
### Dot Expansion ### Dot Expansion

@ -306,14 +306,14 @@ fi
# #
# Set the key layout. # Set the key layout.
zstyle -s ':prezto:module:editor' keymap 'keymap' zstyle -s ':prezto:module:editor' key-bindings 'key_bindings'
if [[ "$keymap" == (emacs|) ]]; then if [[ "$key_bindings" == (emacs|) ]]; then
bindkey -e bindkey -e
elif [[ "$keymap" == vi ]]; then elif [[ "$key_bindings" == vi ]]; then
bindkey -v bindkey -v
else else
print "prezto: invalid keymap: $keymap" >&2 print "prezto: editor: invalid key bindings: $key_bindings" >&2
fi fi
unset key{map,} unset key{,map,bindings}

@ -5,21 +5,21 @@
# #
# Return if requirements are not found. # Return if requirements are not found.
if [[ ! -d "$HOME/.carton" ]]; then if [[ ! -d "$HOME/.cask" ]]; then
return 1 return 1
fi fi
# Prepend Carton bin directory. # Prepend Cask bin directory.
path=($HOME/.carton/bin $path) path=($HOME/.cask/bin $path)
# Load Carton completion # Load Carton completion
source "$HOME/.carton/etc/carton_completion.zsh" 2> /dev/null source "$HOME/.cask/etc/cask_completion.zsh" 2> /dev/null
# #
# Aliases # Aliases
# #
alias cai='carton install' alias cai='cask install'
alias cau='carton update' alias cau='cask update'
alias caI='carton init' alias caI='cask init'
alias cae='carton exec' alias cae='cask exec'

@ -0,0 +1,26 @@
Homebrew
========
Defines Homebrew aliases.
Aliases
-------
- `brewc` cleans outdated brews and their cached archives.
- `brewC` cleans outdated brews, including keg-only, and their cached archives.
- `brewi` installs a formula.
- `brewl` lists installed formulae.
- `brews` searches for a formula.
- `brewU` upgrades Homebrew and outdated brews.
- `brewu` upgrades Homebrew.
- `brewx` uninstalls a formula.
Authors
-------
*The authors of this module should be contacted via the [issue tracker][1].*
- [Sorin Ionescu](https://github.com/sorin-ionescu)
[1]: https://github.com/sorin-ionescu/prezto/issues

@ -0,0 +1,25 @@
#
# Defines Homebrew aliases.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Return if requirements are not found.
if [[ "$OSTYPE" != darwin* ]]; then
return 1
fi
#
# Aliases
#
alias brewc='brew cleanup'
alias brewC='brew cleanup --force'
alias brewi='brew install'
alias brewl='brew list'
alias brews='brew search'
alias brewu='brew upgrade'
alias brewU='brew update && brew upgrade'
alias brewx='brew remove'

@ -6,15 +6,15 @@ Enables local Python and local Python package installation.
Local Python Installation Local Python Installation
------------------------- -------------------------
[pythonz][4] builds and installs multiple Python versions locally in the home [pyenv][4] builds and installs multiple Python versions locally in the home
directory. directory.
This module prepends the pythonz directory to the path variable to enable the This module prepends the pyenv directory to the path variable to enable the
execution of `pythonz`. execution of `pyenv`.
### Usage ### Usage
Install Python versions with `pythonz install` into *~/.pythonz/pythons*. Install Python versions with `pyenv install` into *~/.pyenv/versions*.
Local Package Installation Local Package Installation
-------------------------- --------------------------
@ -66,16 +66,6 @@ Aliases
- `py` is short for `python`. - `py` is short for `python`.
### Pythonz
- `pyz` is short for `pythonz`.
- `pyzc` removes stale source folders and archives.
- `pyzi` installs Python versions.
- `pyzl` lists installed Python versions.
- `pyzL` lists available Python versions.
- `pyzu` updates itself to the latest version.
- `pyzx` uninstalls Python versions.
Functions Functions
--------- ---------
@ -105,6 +95,6 @@ Authors
[1]: http://www.python.org/dev/peps/pep-0370/ [1]: http://www.python.org/dev/peps/pep-0370/
[2]: http://www.doughellmann.com/projects/virtualenvwrapper/ [2]: http://www.doughellmann.com/projects/virtualenvwrapper/
[3]: http://pypi.python.org/pypi/virtualenv [3]: http://pypi.python.org/pypi/virtualenv
[4]: http://saghul.github.com/pythonz/ [4]: https://github.com/yyuu/pyenv
[5]: https://github.com/sorin-ionescu/prezto/issues [5]: https://github.com/sorin-ionescu/prezto/issues

@ -6,29 +6,35 @@
# Sebastian Wiesner <lunaryorn@googlemail.com> # Sebastian Wiesner <lunaryorn@googlemail.com>
# #
# Load pythonz into the shell session. # Load manually installed pyenv into the shell session.
if [[ -s $HOME/.pythonz/bin/pythonz ]]; then if [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then
path=($HOME/.pythonz/bin $path) path=("$HOME/.pyenv/bin" $path)
fi eval "$(pyenv init -)"
# Return if requirements are not found. # Load package manager installed pyenv into the shell session.
if (( ! $+commands[python] && ! $+commands[pythonz] )); then elif (( $+commands[pyenv] )); then
return 1 eval "$(pyenv init -)"
fi
# Prepend PEP 370 per user site packages directory, which defaults to # Prepend PEP 370 per user site packages directory, which defaults to
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. # ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH.
if [[ "$OSTYPE" == darwin* ]]; then
path=($HOME/Library/Python/*/bin(N) $path)
else else
if [[ "$OSTYPE" == darwin* ]]; then
path=($HOME/Library/Python/*/bin(N) $path)
else
# This is subject to change. # This is subject to change.
path=($HOME/.local/bin $path) path=($HOME/.local/bin $path)
fi
fi
# Return if requirements are not found.
if (( ! $+commands[python] && ! $+commands[pyenv] )); then
return 1
fi fi
# Load virtualenvwrapper into the shell session. # Load virtualenvwrapper into the shell session.
if (( $+commands[virtualenvwrapper_lazy.sh] )); then if (( $+commands[virtualenvwrapper_lazy.sh] )); then
# Set the directory where virtual environments are stored. # Set the directory where virtual environments are stored.
export WORKON_HOME=$HOME/.virtualenvs export WORKON_HOME="$HOME/.virtualenvs"
# Disable the virtualenv prompt. # Disable the virtualenv prompt.
VIRTUAL_ENV_DISABLE_PROMPT=1 VIRTUAL_ENV_DISABLE_PROMPT=1
@ -42,14 +48,3 @@ fi
alias py='python' alias py='python'
# pythonz
if (( $+commands[pythonz] )); then
alias pyz='pythonz'
alias pyzc='pythonz cleanup'
alias pyzi='pythonz install'
alias pyzl='pythonz list'
alias pyzL='pythonz list -a'
alias pyzu='pythonz update'
alias pyzx='pythonz uninstall'
fi

@ -10,9 +10,15 @@ Settings
Starts a GNU Screen session automatically when Zsh is launched. Starts a GNU Screen session automatically when Zsh is launched.
To enable this feature, add the following line to *zpreztorc*: To enable this feature when launching Zsh in a local terminal, add the
following line to *zpreztorc*:
zstyle ':prezto:module:screen' auto-start 'yes' zstyle ':prezto:module:screen:auto-start' local 'yes'
To enable this feature when launching Zsh in a SSH connection, add the
following line to *zpreztorc*:
zstyle ':prezto:module:screen:auto-start' remote 'yes'
Aliases Aliases
------- -------
@ -28,6 +34,7 @@ Authors
*The authors of this module should be contacted via the [issue tracker][2].* *The authors of this module should be contacted via the [issue tracker][2].*
- [Sorin Ionescu](https://github.com/sorin-ionescu) - [Sorin Ionescu](https://github.com/sorin-ionescu)
- [Georges Discry](https://github.com/gdiscry)
[1]: http://www.gnu.org/software/screen/ [1]: http://www.gnu.org/software/screen/
[2]: https://github.com/sorin-ionescu/prezto/issues [2]: https://github.com/sorin-ionescu/prezto/issues

@ -3,6 +3,7 @@
# #
# Authors: # Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# Georges Discry <georges@discry.be>
# #
# Return if requirements are not found. # Return if requirements are not found.
@ -14,7 +15,10 @@ fi
# Auto Start # Auto Start
# #
if [[ -z "$STY" ]] && zstyle -t ':prezto:module:screen' auto-start; then if [[ -z "$STY" ]] && ( \
( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' remote ) ||
( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' local ) \
); then
session="$( session="$(
screen -list 2> /dev/null \ screen -list 2> /dev/null \
| sed '1d;$d' \ | sed '1d;$d' \

@ -27,22 +27,22 @@ else
source "$_ssh_agent_env" 2> /dev/null source "$_ssh_agent_env" 2> /dev/null
fi fi
# Load identities.
if ssh-add -l 2>&1 | grep 'The agent has no identities'; then
zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities'
if (( ${#identities} > 0 )); then
ssh-add "$_ssh_dir/${^_ssh_identities[@]}"
else
ssh-add
fi
fi
# Create a persistent SSH authentication socket. # Create a persistent SSH authentication socket.
if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then
ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock" ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock"
export SSH_AUTH_SOCK="$_ssh_agent_sock" export SSH_AUTH_SOCK="$_ssh_agent_sock"
fi fi
# Load identities.
if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then
zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities'
if (( ${#_ssh_identities} > 0 )); then
ssh-add "$_ssh_dir/${^_ssh_identities[@]}" 2> /dev/null
else
ssh-add 2> /dev/null
fi
fi
# Clean up. # Clean up.
unset _ssh_{dir,identities} _ssh_agent_{env,sock} unset _ssh_{dir,identities} _ssh_agent_{env,sock}

@ -10,12 +10,18 @@ Settings
Starts a tmux session automatically when Zsh is launched. Starts a tmux session automatically when Zsh is launched.
To enable this feature, add the following line to *zpreztorc*: To enable this feature when launching Zsh in a local terminal, add the
following line to *zpreztorc*:
zstyle ':prezto:module:tmux' auto-start 'yes' zstyle ':prezto:module:tmux:auto-start' local 'yes'
It will create a background session named _#Prezto_ and attach every new shell To enable this feature when launching Zsh in a SSH connection, add the
to it. following line to *zpreztorc*:
zstyle ':prezto:module:tmux:auto-start' remote 'yes'
In both cases, it will create a background session named _#Prezto_ and attach
every new shell to it.
To avoid keeping open sessions, this module sets `destroy-unattached off` on To avoid keeping open sessions, this module sets `destroy-unattached off` on
the background session and `destroy-unattached on` on every other session the background session and `destroy-unattached on` on every other session
@ -47,6 +53,7 @@ Authors
- [Sorin Ionescu](https://github.com/sorin-ionescu) - [Sorin Ionescu](https://github.com/sorin-ionescu)
- [Colin Hebert](https://github.com/ColinHebert) - [Colin Hebert](https://github.com/ColinHebert)
- [Georges Discry](https://github.com/gdiscry)
[1]: http://tmux.sourceforge.net [1]: http://tmux.sourceforge.net
[2]: https://github.com/sorin-ionescu/prezto/issues/62 [2]: https://github.com/sorin-ionescu/prezto/issues/62

@ -4,6 +4,7 @@
# Authors: # Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# Colin Hebert <hebert.colin@gmail.com> # Colin Hebert <hebert.colin@gmail.com>
# Georges Discry <georges@discry.be>
# #
# Return if requirements are not found. # Return if requirements are not found.
@ -15,7 +16,10 @@ fi
# Auto Start # Auto Start
# #
if [[ -z "$TMUX" ]] && zstyle -t ':prezto:module:tmux' auto-start; then if [[ -z "$TMUX" ]] && ( \
( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) ||
( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \
); then
tmux_session='#Prezto' tmux_session='#Prezto'
if ! tmux has-session -t "$tmux_session" 2> /dev/null; then if ! tmux has-session -t "$tmux_session" 2> /dev/null; then

@ -104,17 +104,17 @@ alias sl='ls' # I often screw this up.
# Mac OS X Everywhere # Mac OS X Everywhere
if [[ "$OSTYPE" == darwin* ]]; then if [[ "$OSTYPE" == darwin* ]]; then
alias o='open' alias o='open'
alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time' elif [[ "$OSTYPE" == cygwin* ]]; then
alias o='cygstart'
alias pbcopy='tee > /dev/clipboard'
alias pbpaste='cat /dev/clipboard'
else else
alias o='xdg-open' alias o='xdg-open'
alias get='wget --continue --progress=bar --timestamping'
if (( $+commands[xclip] )); then if (( $+commands[xclip] )); then
alias pbcopy='xclip -selection clipboard -in' alias pbcopy='xclip -selection clipboard -in'
alias pbpaste='xclip -selection clipboard -out' alias pbpaste='xclip -selection clipboard -out'
fi elif (( $+commands[xsel] )); then
if (( $+commands[xsel] )); then
alias pbcopy='xsel --clipboard --input' alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output' alias pbpaste='xsel --clipboard --output'
fi fi
@ -123,6 +123,13 @@ fi
alias pbc='pbcopy' alias pbc='pbcopy'
alias pbp='pbpaste' alias pbp='pbpaste'
# File Download
if (( $+commands[curl] )); then
alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time'
elif (( $+commands[wget] )); then
alias get='wget --continue --progress=bar --timestamping'
fi
# Resource Usage # Resource Usage
alias df='df -kh' alias df='df -kh'
alias du='du -kh' alias du='du -kh'

@ -39,7 +39,7 @@ zstyle ':prezto:load' pmodule \
# #
# Set the key mapping style to 'emacs' or 'vi'. # Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' keymap 'emacs' zstyle ':prezto:module:editor' key-bindings 'emacs'
# Auto convert .... to ../.. # Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes' # zstyle ':prezto:module:editor' dot-expansion 'yes'
@ -91,8 +91,11 @@ zstyle ':prezto:module:prompt' theme 'sorin'
# Screen # Screen
# #
# Auto start a session when Zsh is launched. # Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:screen' auto-start 'yes' # zstyle ':prezto:module:screen:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:screen:auto-start' remote 'yes'
# #
# SSH # SSH
@ -132,6 +135,9 @@ zstyle ':prezto:module:terminal' auto-title 'yes'
# Tmux # Tmux
# #
# Auto start a session when Zsh is launched. # Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:tmux' auto-start 'yes' # zstyle ':prezto:module:tmux:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:tmux:auto-start' remote 'yes'

Loading…
Cancel
Save