Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'original/master'
Browse files Browse the repository at this point in the history
* original/master: (70 commits)
  Comment an unnecessary style
  Stop module loading when external code fails to source
  Use correct option for pacman search aliases
  Do not define $GEM_HOME
  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 sorin-ionescu#459] Correct typos in the dpkg module
  [Fix sorin-ionescu#452] Squash bugs introduced in fcab2a1
  [Fix sorin-ionescu#411] Add Homebrew module
  [Fix sorin-ionescu#434] Correct ambiguity in the use of the term keymap
  Rename archive module functions
  [Fix sorin-ionescu#436] Update link to Bombich rsync
  ...

Conflicts:
	modules/ssh-agent/init.zsh
  • Loading branch information
weyhmueller committed Sep 7, 2013
2 parents cc06371 + eb1a205 commit 80a8a0e
Show file tree
Hide file tree
Showing 58 changed files with 848 additions and 620 deletions.
26 changes: 4 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,6 @@ version is 4.3.10.

5. Open a new Zsh terminal window or tab.

### Mac OS X

If you have administrator privileges, you must fix an Apple-introduced problem
in Mac OS X 10.5 Leopard by executing the following command, or BASH and Zsh
will have the wrong `PATH` when executed non-interactively.

sudo chmod ugo-x /usr/libexec/path_helper

`path_helper` is intended to make it easier for installers to add new paths to
the environment without having to edit shell configuration files by adding
a file with a path to the */etc/paths.d* directory.

Unfortunately, `path_helper` always reads paths from */etc/paths* set by Apple
then paths from */etc/paths.d* set by third party installers, and lastly paths
from the `PATH` environment variable set by the parent process, which
ultimately is set by the user with `export PATH=...` Thus, it reorders path
priorities, and user */bin* directories meant to override system */bin*
directories end up at the tail of the array.

### Troubleshooting

If you are not able to find certain commands after switching to *Prezto*,
Expand Down Expand Up @@ -82,9 +63,10 @@ accompanying README files to learn of what is available.
Customization
-------------

The project is managed via [Git][3]. It is highly recommend that you commit
your changes and push them to [GitHub][4] to not lose them. If you do not know
how to use Git, follow this [tutorial][5] and bookmark this [reference][6].
The project is managed via [Git][3]. It is highly recommended that you fork this
project; so, that you can commit your changes and push them to [GitHub][4] to
not lose them. If you do not know how to use Git, follow this [tutorial][5] and
bookmark this [reference][6].

Resources
---------
Expand Down
11 changes: 8 additions & 3 deletions modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Load modules in *zpreztorc*. The order matters.
Archive
-------

Provides functions to extract and list popular archive formats.
Provides functions to list and extract archives.

Command-Not-Found
-----------------
Expand Down Expand Up @@ -46,10 +46,10 @@ GNU Utility

Provides for the interactive use of GNU utilities on non-GNU systems.

GPG-Agent
GPG
---------

Provides for an easier use of gpg-agent.
Provides for an easier use of GPG by setting up gpg-agent.

Haskell
-------
Expand All @@ -71,6 +71,11 @@ History

Sets history options and defines history aliases.

Homebrew
--------

Defines Homebrew aliases.

Macports
--------

Expand Down
8 changes: 4 additions & 4 deletions modules/archive/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Archive
=======

Provides functions to extract and list popular archive formats.
Provides functions to list and extract archives.

Functions
---------

- `extract` extracts the contents of one or more archives.
- `ls-archive` lists the contents of one or more archives.
- `lsarchive` lists the contents of one or more archives.
- `unarchive` extracts the contents of one or more archives.

Supported Formats
-----------------
Expand All @@ -26,7 +26,7 @@ installed:
- *.lzma* requires `unlzma`.
- *.Z* requires `uncompress`.
- *.zip* requires `unzip`.
- *.rar* requires `unrar`.
- *.rar* requires `unrar` or `rar`.
- *.7z* requires `7za`.
- *.deb* requires `ar`, `tar`.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#compdef ls-archive
#compdef lsarchive
#autoload

#
# Completes ls-archive.
# Completes lsarchive.
#
# Authors:
# Sorin Ionescu <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#compdef extract
#compdef unarchive
#autoload

#
# Completes extract.
# Completes unarchive.
#
# Authors:
# Sorin Ionescu <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Lists the contents of popular archive formats.
# Lists the contents of archives.
#
# Authors:
# Sorin Ionescu <[email protected]>
Expand Down Expand Up @@ -41,7 +41,9 @@ while (( $# > 0 )); do
|| lzcat "$1" | tar x${verbose:+v}f - ;;
(*.tar) tar t${verbose:+v}f "$1" ;;
(*.zip) unzip -l${verbose:+v} "$1" ;;
(*.rar) unrar ${${verbose:+v}:-l} "$1" ;;
(*.rar) unrar &> /dev/null \
&& unrar ${${verbose:+v}:-l} "$1" \
|| rar ${${verbose:+v}:-l} "$1" ;;
(*.7z) 7za l "$1" ;;
(*)
print "$0: cannot list: $1" >&2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Extracts the contents of popular archive formats.
# Extracts the contents of archives.
#
# Authors:
# Sorin Ionescu <[email protected]>
Expand Down Expand Up @@ -53,7 +53,9 @@ while (( $# > 0 )); do
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
(*.zip) unzip "$1" -d $extract_dir ;;
(*.rar) unrar e -ad "$1" ;;
(*.rar) unrar &> /dev/null \
&& unrar e -ad "$1" \
|| rar e -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)
mkdir -p "$extract_dir/control"
Expand Down
3 changes: 0 additions & 3 deletions modules/completion/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ setopt AUTO_PARAM_SLASH # If completed parameter is a directory, add a traili
unsetopt MENU_COMPLETE # Do not autoselect the first completion entry.
unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor.

# Treat these characters as part of a word.
WORDCHARS='*?_-.[]~&;!#$%^(){}<>'

#
# Styles
#
Expand Down
6 changes: 3 additions & 3 deletions modules/dpkg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ Aliases
-------

- `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 files.
- `debq` displays package information.
- `debu` updates the packages lists.
- `debu` updates the package lists.
- `debU` upgrades outdated packages.
- `debx` removes packages.
- `debX` removes packages, their configuration, and unneeded dependencies.
- `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
use.

Expand Down
6 changes: 3 additions & 3 deletions modules/dpkg/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi
# Cleans the cache.
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'

# Installs packages from repositories.
Expand All @@ -31,7 +31,7 @@ alias debI='sudo dpkg -i'
# Displays package information.
alias debq='apt-cache show'

# Updates the packages lists.
# Updates the package lists.
alias debu='sudo apt-get update'

# Upgrades outdated packages.
Expand All @@ -50,7 +50,7 @@ else
alias debs='apt-cache search'
fi

# Creates a basic .deb package.
# Creates a basic deb package.
alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc'

# Removes all kernel images and headers, except for the ones in use.
Expand Down
63 changes: 63 additions & 0 deletions modules/editor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Editor
======

Sets key bindings.

Settings
--------

### Key bindings

To enable key bindings, add the following to *zpreztorc*, and replace 'bindings'
with 'emacs' or 'vi'.

zstyle ':prezto:module:editor' key-bindings 'bindings'

### Dot Expansion

To enable the auto conversion of .... to ../.., add the following to
*zpreztorc*.

zstyle ':prezto:module:editor' dot-expansion 'yes'

Theming
-------

To indicate when the editor is in the primary keymap (emacs or viins), add
the following to your `theme_prompt_setup` function.

zstyle ':prezto:module:editor:info:keymap:primary' format '>>>'

To indicate when the editor is in the primary keymap (emacs or viins) insert
mode, add the following to your `theme_prompt_setup` function.

zstyle ':prezto:module:editor:info:keymap:primary:insert' format 'I'

To indicate when the editor is in the primary keymap (emacs or viins) overwrite
mode, add the following to your `theme_prompt_setup` function.

zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format 'O'

To indicate when the editor is in the alternate keymap (vicmd), add the
following to your `theme_prompt_setup` function.

zstyle ':prezto:module:editor:info:keymap:alternate' format '<<<'

To indicate when the editor is completing, add the following to your
`theme_prompt_setup` function.

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.

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/oh-my-zsh/issues

56 changes: 11 additions & 45 deletions modules/editor/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,6 @@
# Authors:
# Sorin Ionescu <[email protected]>
#
# Usage:
# To enable key bindings, add the following to zpreztorc, and replace 'map'
# with 'emacs' or 'vi.
#
# zstyle ':prezto:module:editor' keymap 'map'
#
# To enable the auto conversion of .... to ../.., add the following to
# zpreztorc.
#
# zstyle ':prezto:module:editor' dot-expansion 'yes'
#
# To indicate when the editor is in the primary keymap (emacs or viins), add
# the following to your theme prompt setup function.
#
# zstyle ':prezto:module:editor:info:keymap:primary' format '>>>'
#
# To indicate when the editor is in the primary keymap (emacs or viins) insert
# mode, add the following to your theme prompt setup function.
#
# zstyle ':prezto:module:editor:info:keymap:primary:insert' format 'I'
#
# To indicate when the editor is in the primary keymap (emacs or viins)
# overwrite mode, add the following to your theme prompt setup function.
#
# zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format 'O'
#
# To indicate when the editor is in the alternate keymap (vicmd), add the
# following to your theme prompt setup function.
#
# zstyle ':prezto:module:editor:info:keymap:alternate' format '<<<'
#
# To indicate when the editor is completing, add the following to your theme
# prompt setup function.
#
# zstyle ':prezto:module:editor:info:completing' format '...'
#

# Return if requirements are not found.
if [[ "$TERM" == 'dumb' ]]; then
Expand All @@ -57,6 +21,9 @@ setopt BEEP
# Variables
#

# Treat these characters as part of a word.
WORDCHARS='*?_-.[]~&;!#$%^(){}<>'

# Use human-friendly identifiers.
zmodload zsh/terminfo
typeset -gA key_info
Expand Down Expand Up @@ -90,12 +57,11 @@ key_info=(
'BackTab' "$terminfo[kcbt]"
)

# Do not bind any keys if there are empty values in $key_info.
# 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
print "prezto: one or more keys are non-bindable" >&2
unset key{,_info}
return 1
key_info["$key"]=''
fi
done

Expand Down Expand Up @@ -340,14 +306,14 @@ fi
#

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

unset key{map,}
unset key{,map,bindings}

Loading

0 comments on commit 80a8a0e

Please sign in to comment.