mirror of
https://github.com/sorin-ionescu/prezto.git
synced 2025-02-02 21:12:16 +08:00
Compare commits
3 Commits
b0173e06ef
...
876373bebb
Author | SHA1 | Date | |
---|---|---|---|
|
876373bebb | ||
|
6e564503f1 | ||
|
84e0787411 |
2
init.zsh
2
init.zsh
@ -173,7 +173,7 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable color and theme in dumb terminals.
|
# Disable color and theme in dumb terminals.
|
||||||
if [[ "$TERM" == 'dumb' ]]; then
|
if [[ $TERM == dumb ]]; then
|
||||||
zstyle ':prezto:*:*' color 'no'
|
zstyle ':prezto:*:*' color 'no'
|
||||||
zstyle ':prezto:module:prompt' theme 'off'
|
zstyle ':prezto:module:prompt' theme 'off'
|
||||||
fi
|
fi
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
local archive_name path_to_archive _gzip_bin _bzip2_bin _xz_bin _zstd_bin
|
local archive_name path_to_archive _gzip_bin _bzip2_bin _xz_bin _zstd_bin
|
||||||
|
|
||||||
if (( $# < 2 )); then
|
if (( $# < 2 )); then
|
||||||
cat >&2 <<EOF
|
>&2 <<EOF
|
||||||
usage: $0 [archive_name.zip] [/path/to/include/into/archive ...]
|
usage: $0 [archive_name.zip] [/path/to/include/into/archive ...]
|
||||||
|
|
||||||
Where 'archive.zip' uses any of the following extensions:
|
Where 'archive.zip' uses any of the following extensions:
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
local verbose
|
local verbose
|
||||||
|
|
||||||
if (( $# == 0 )); then
|
if (( $# == 0 )); then
|
||||||
cat >&2 <<EOF
|
>&2 <<EOF
|
||||||
usage: $0 [-option] [file ...]
|
usage: $0 [-option] [file ...]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
|
@ -15,7 +15,7 @@ local extract_dir
|
|||||||
local _gzip_bin _bzip2_bin _xz_bin _zstd_bin
|
local _gzip_bin _bzip2_bin _xz_bin _zstd_bin
|
||||||
|
|
||||||
if (( $# == 0 )); then
|
if (( $# == 0 )); then
|
||||||
cat >&2 <<EOF
|
>&2 <<EOF
|
||||||
usage: $0 [-option] [file ...]
|
usage: $0 [-option] [file ...]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Return if requirements are not found.
|
# Return if requirements are not found.
|
||||||
if [[ $TERM == 'dumb' ]]; then
|
if [[ $TERM == dumb ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ case "$1" in
|
|||||||
zcat $(ls -rt /var/log/dpkg*)
|
zcat $(ls -rt /var/log/dpkg*)
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
cat >&2 <<EOF
|
>&2 <<EOF
|
||||||
Commands:
|
Commands:
|
||||||
install - List installed packages
|
install - List installed packages
|
||||||
upgrade - List upgraded packages
|
upgrade - List upgraded packages
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# paste had a regression. Additionally, 5.2 added bracketed-paste-url-magic
|
# paste had a regression. Additionally, 5.2 added bracketed-paste-url-magic
|
||||||
# which is generally better than url-quote-magic so we load that when possible.
|
# which is generally better than url-quote-magic so we load that when possible.
|
||||||
autoload -Uz is-at-least
|
autoload -Uz is-at-least
|
||||||
if [[ ${ZSH_VERSION} != 5.1.1 && ${TERM} != "dumb" ]]; then
|
if [[ $ZSH_VERSION != 5.1.1 && $TERM != dumb ]]; then
|
||||||
if is-at-least 5.2; then
|
if is-at-least 5.2; then
|
||||||
autoload -Uz bracketed-paste-url-magic
|
autoload -Uz bracketed-paste-url-magic
|
||||||
zle -N bracketed-paste bracketed-paste-url-magic
|
zle -N bracketed-paste bracketed-paste-url-magic
|
||||||
@ -34,7 +34,8 @@ setopt COMBINING_CHARS # Combine zero-length punctuation characters (accent
|
|||||||
# with the base character.
|
# with the base character.
|
||||||
setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell.
|
setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell.
|
||||||
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'.
|
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'.
|
||||||
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed.
|
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has
|
||||||
|
# been accessed.
|
||||||
|
|
||||||
# Allow mapping Ctrl+S and Ctrl+Q shortcuts
|
# Allow mapping Ctrl+S and Ctrl+Q shortcuts
|
||||||
[[ -r ${TTY:-} && -w ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY
|
[[ -r ${TTY:-} && -w ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Return if requirements are not found.
|
# Return if requirements are not found.
|
||||||
if [[ "$TERM" == 'dumb' ]]; then
|
if [[ $TERM == dumb ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Return if requirements are not found.
|
# Return if requirements are not found.
|
||||||
if [[ "$TERM" == (dumb|linux|*bsd*|eterm*) ]]; then
|
if [[ $TERM == (dumb|linux|*bsd*|eterm*) ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ function _terminal-set-titles-with-command {
|
|||||||
local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}"
|
local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}"
|
||||||
unset MATCH
|
unset MATCH
|
||||||
|
|
||||||
if [[ "$TERM" == screen* ]]; then
|
if [[ $TERM == screen* ]]; then
|
||||||
set-multiplexer-title "$truncated_cmd"
|
set-multiplexer-title "$truncated_cmd"
|
||||||
fi
|
fi
|
||||||
set-tab-title "$truncated_cmd"
|
set-tab-title "$truncated_cmd"
|
||||||
@ -78,7 +78,7 @@ function _terminal-set-titles-with-path {
|
|||||||
local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}"
|
local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}"
|
||||||
unset MATCH
|
unset MATCH
|
||||||
|
|
||||||
if [[ "$TERM" == screen* ]]; then
|
if [[ $TERM == screen* ]]; then
|
||||||
set-multiplexer-title "$truncated_path"
|
set-multiplexer-title "$truncated_path"
|
||||||
fi
|
fi
|
||||||
set-tab-title "$truncated_path"
|
set-tab-title "$truncated_path"
|
||||||
@ -89,7 +89,7 @@ function _terminal-set-titles-with-path {
|
|||||||
autoload -Uz add-zsh-hook
|
autoload -Uz add-zsh-hook
|
||||||
|
|
||||||
# Set up the Apple Terminal.
|
# Set up the Apple Terminal.
|
||||||
if [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] \
|
if [[ $TERM_PROGRAM == Apple_Terminal ]] \
|
||||||
&& ( ! [[ -n "$STY" || -n "$TMUX" || -n "$DVTM" ]] )
|
&& ( ! [[ -n "$STY" || -n "$TMUX" || -n "$DVTM" ]] )
|
||||||
then
|
then
|
||||||
# Sets the Terminal.app current working directory before the prompt is
|
# Sets the Terminal.app current working directory before the prompt is
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
local usage pattern modifiers invert
|
local usage pattern modifiers invert
|
||||||
|
|
||||||
usage="$(
|
usage="$(<<EOF
|
||||||
cat <<EOF
|
|
||||||
usage: $0 [-option ...] [--] pattern [file ...]
|
usage: $0 [-option ...] [--] pattern [file ...]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
local usage pattern replacement modifiers
|
local usage pattern replacement modifiers
|
||||||
|
|
||||||
usage="$(
|
usage="$(<<EOF
|
||||||
cat <<EOF
|
|
||||||
usage: $0 [-option ...] [--] pattern replacement [file ...]
|
usage: $0 [-option ...] [--] pattern replacement [file ...]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
# function zsh-help {
|
# function zsh-help {
|
||||||
|
|
||||||
local usage="$(
|
local usage="$(<<EOF
|
||||||
cat <<EOF
|
|
||||||
usage: $0 [--help] [--zsh-help-debug] [--all] search term(s)
|
usage: $0 [--help] [--zsh-help-debug] [--all] search term(s)
|
||||||
Options:
|
Options:
|
||||||
--all - search for the term anywhere, not just at the start of a line.
|
--all - search for the term anywhere, not just at the start of a line.
|
||||||
|
@ -14,6 +14,6 @@ SAYINGS=(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Print a randomly-chosen message:
|
# Print a randomly-chosen message:
|
||||||
echo $SAYINGS[$(($RANDOM % ${#SAYINGS} + 1))]
|
echo $SAYINGS[$(($RANDOM % $#SAYINGS + 1))]
|
||||||
|
|
||||||
} >&2
|
} >&2
|
||||||
|
Loading…
Reference in New Issue
Block a user