mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 18:38:00 +00:00
Merge upstream/master
This commit is contained in:
commit
82222831a7
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
# function archive {
|
# function archive {
|
||||||
|
|
||||||
local archive_name path_to_archive _gzip_bin _bzip2_bin
|
local archive_name path_to_archive _gzip_bin _bzip2_bin _xz_bin
|
||||||
|
|
||||||
if (( $# < 2 )); then
|
if (( $# < 2 )); then
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
@ -40,7 +40,15 @@ else
|
|||||||
_gzip_bin='gzip'
|
_gzip_bin='gzip'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $+commands[pbzip2] )); then
|
if (( $+commands[pixz] )); then
|
||||||
|
_xz_bin='pixz'
|
||||||
|
else
|
||||||
|
_xz_bin='xz'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $+commands[lbzip2] )); then
|
||||||
|
_bzip2_bin='lbzip2'
|
||||||
|
elif (( $+commands[pbzip2] )); then
|
||||||
_bzip2_bin='pbzip2'
|
_bzip2_bin='pbzip2'
|
||||||
else
|
else
|
||||||
_bzip2_bin='bzip2'
|
_bzip2_bin='bzip2'
|
||||||
@ -49,7 +57,7 @@ fi
|
|||||||
case "${archive_name}" in
|
case "${archive_name}" in
|
||||||
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${=path_to_archive}" ;;
|
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${=path_to_archive}" ;;
|
||||||
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${=path_to_archive}" ;;
|
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${=path_to_archive}" ;;
|
||||||
(*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${=path_to_archive}" ;;
|
(*.tar.xz|*.txz) tar -cvf "${archive_name}" --use-compress-program="${_xz_bin}" "${=path_to_archive}" ;;
|
||||||
(*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${=path_to_archive}" ;;
|
(*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${=path_to_archive}" ;;
|
||||||
(*.tar) tar -cvf "${archive_name}" "${=path_to_archive}" ;;
|
(*.tar) tar -cvf "${archive_name}" "${=path_to_archive}" ;;
|
||||||
(*.zip|*.jar) zip -r "${archive_name}" "${=path_to_archive}" ;;
|
(*.zip|*.jar) zip -r "${archive_name}" "${=path_to_archive}" ;;
|
||||||
|
@ -12,6 +12,7 @@ local success
|
|||||||
local file_name
|
local file_name
|
||||||
local file_path
|
local file_path
|
||||||
local extract_dir
|
local extract_dir
|
||||||
|
local _gzip_bin _bzip2_bin _xz_bin
|
||||||
|
|
||||||
if (( $# == 0 )); then
|
if (( $# == 0 )); then
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
@ -30,6 +31,29 @@ if [[ "$1" == "-r" || "$1" == "--remove" ]]; then
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# here, we check for dropin/multi-threaded replacements
|
||||||
|
# this should eventually be moved to modules/archive/init.zsh
|
||||||
|
# as a global alias
|
||||||
|
if (( $+commands[pigz] )); then
|
||||||
|
_gzip_bin='pigz'
|
||||||
|
else
|
||||||
|
_gzip_bin='gzip'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $+commands[pixz] )); then
|
||||||
|
_xz_bin='pixz'
|
||||||
|
else
|
||||||
|
_xz_bin='xz'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $+commands[lbzip2] )); then
|
||||||
|
_bzip2_bin='lbzip2'
|
||||||
|
elif (( $+commands[pbzip2] )); then
|
||||||
|
_bzip2_bin='pbzip2'
|
||||||
|
else
|
||||||
|
_bzip2_bin='bzip2'
|
||||||
|
fi
|
||||||
|
|
||||||
while (( $# > 0 )); do
|
while (( $# > 0 )); do
|
||||||
if [[ ! -s "$1" ]]; then
|
if [[ ! -s "$1" ]]; then
|
||||||
print "$0: file not valid: $1" >&2
|
print "$0: file not valid: $1" >&2
|
||||||
@ -42,15 +66,13 @@ while (( $# > 0 )); do
|
|||||||
file_path="${1:A}"
|
file_path="${1:A}"
|
||||||
extract_dir="${file_name:r}"
|
extract_dir="${file_name:r}"
|
||||||
case "$1:l" in
|
case "$1:l" in
|
||||||
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
|
(*.tar.gz|*.tgz) tar -xvf "$1" --use-compress-program="${_gzip_bin}" ;;
|
||||||
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
|
(*.tar.bz2|*.tbz|*.tbz2) tar -xvf "$1" --use-compress-program="${_bzip2_bin}" ;;
|
||||||
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
|
(*.tar.xz|*.txz) tar -xvf "$1" --use-compress-program="${_xz_bin}" ;;
|
||||||
&& tar --xz -xvf "$1" \
|
|
||||||
|| xzcat "$1" | tar xvf - ;;
|
|
||||||
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
|
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
|
||||||
&& tar --lzma -xvf "$1" \
|
&& tar --lzma -xvf "$1" \
|
||||||
|| lzcat "$1" | tar xvf - ;;
|
|| lzcat "$1" | tar -xvf - ;;
|
||||||
(*.tar) tar xvf "$1" ;;
|
(*.tar) tar -xvf "$1" ;;
|
||||||
(*.gz) gunzip "$1" ;;
|
(*.gz) gunzip "$1" ;;
|
||||||
(*.bz2) bunzip2 "$1" ;;
|
(*.bz2) bunzip2 "$1" ;;
|
||||||
(*.xz) unxz "$1" ;;
|
(*.xz) unxz "$1" ;;
|
||||||
|
@ -269,9 +269,11 @@ bindkey -d
|
|||||||
# Emacs Key Bindings
|
# Emacs Key Bindings
|
||||||
#
|
#
|
||||||
|
|
||||||
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}"
|
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" \
|
||||||
|
"${key_info[Escape]}${key_info[Left]}"
|
||||||
bindkey -M emacs "$key" emacs-backward-word
|
bindkey -M emacs "$key" emacs-backward-word
|
||||||
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}"
|
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" \
|
||||||
|
"${key_info[Escape]}${key_info[Right]}"
|
||||||
bindkey -M emacs "$key" emacs-forward-word
|
bindkey -M emacs "$key" emacs-forward-word
|
||||||
|
|
||||||
# Kill to the beginning of the line.
|
# Kill to the beginning of the line.
|
||||||
|
@ -23,7 +23,7 @@ elif (( $+commands[node] )) ; then
|
|||||||
version="${$(node -v)#v}"
|
version="${$(node -v)#v}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$version" != (none|) ]]; then
|
if [[ "$version" != (none|system) ]]; then
|
||||||
zstyle -s ':prezto:module:node:info:version' format 'version_format'
|
zstyle -s ':prezto:module:node:info:version' format 'version_format'
|
||||||
zformat -f version_formatted "$version_format" "v:$version"
|
zformat -f version_formatted "$version_format" "v:$version"
|
||||||
node_info[version]="$version_formatted"
|
node_info[version]="$version_formatted"
|
||||||
|
@ -62,6 +62,12 @@ Aliases
|
|||||||
- `mysql`
|
- `mysql`
|
||||||
- `rm`
|
- `rm`
|
||||||
|
|
||||||
|
To disable all spelling corrections, add the following line to *zpreztorc*:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
zstyle ':prezto:module:utility' correct 'no'
|
||||||
|
```
|
||||||
|
|
||||||
### Disabled File Globbing
|
### Disabled File Globbing
|
||||||
|
|
||||||
- `bower`
|
- `bower`
|
||||||
|
@ -11,7 +11,9 @@
|
|||||||
pmodload 'helper' 'spectrum'
|
pmodload 'helper' 'spectrum'
|
||||||
|
|
||||||
# Correct commands.
|
# Correct commands.
|
||||||
setopt CORRECT
|
if zstyle -T ':prezto:module:utility' correct; then
|
||||||
|
setopt CORRECT
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Aliases
|
# Aliases
|
||||||
|
Loading…
Reference in New Issue
Block a user