1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 08:41:43 +00:00

Simplified option variables for greater flexibility.

This commit is contained in:
Sorin Ionescu
2011-09-05 15:39:37 -04:00
parent 8619dd28bc
commit 05c94e2dd5
10 changed files with 25 additions and 25 deletions

View File

@ -2,7 +2,7 @@ setopt correct # Correct commands.
setopt correct_all # Correct all arguments.
# The 'ls' Family
if ! check-bool "$DISABLE_COLOR"; then
if check-bool "$COLOR"; then
if [[ -f "$HOME/.dir_colors" ]] && ( (( $+commands[dircolors] )) || ( (( $+plugins[(er)gnu-utils] )) && (( $+commands[gdircolors] )) ) ); then
eval $("${commands[dircolors]:-$commands[gdircolors]}" "$HOME/.dir_colors")
alias ls='ls -hF --group-directories-first --color=auto'
@ -80,7 +80,7 @@ else
fi
# Diff/Make
if ! check-bool "$DISABLE_COLOR"; then
if check-bool "$COLOR"; then
if (( $+commands[colordiff] )); then
alias diff='colordiff -u'
compdef colordiff=diff

View File

@ -64,7 +64,7 @@ export VISUAL="vim"
export PAGER='less'
# Grep
if ! check-bool "$DISABLE_COLOR"; then
if check-bool "$COLOR"; then
export GREP_COLOR='37;45'
export GREP_OPTIONS='--color=auto'
fi
@ -89,7 +89,7 @@ if (( $+commands[lesspipe.sh] )); then
fi
# Termcap
if ! check-bool "$DISABLE_COLOR"; then
if check-bool "$COLOR"; then
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;31m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode

View File

@ -67,7 +67,7 @@ if [[ "$KEYMAP" == (emacs|) ]]; then
bindkey "${keys[Control]}x${keys[Control]}e" edit-command-line
# Expand .... to ../..
if ! check-bool "$DISABLE_DOT_EXPANSION"; then
if check-bool "$DOT_EXPANSION"; then
bindkey "." expand-dot-to-parent-directory-path
fi
@ -132,7 +132,7 @@ elif [[ "$KEYMAP" == 'vi' ]]; then
bindkey -M vicmd "${keys[Control]}r" redo
# Expand .... to ../..
if ! check-bool "$DISABLE_DOT_EXPANSION"; then
if check-bool "$DOT_EXPANSION"; then
bindkey -M viins "." expand-dot-to-parent-directory-path
fi
@ -233,7 +233,7 @@ bindkey '^[[Z' reverse-menu-complete
bindkey "${keys[Control]}i" expand-or-complete-prefix
# Convert .... to ../.. automatically.
if ! check-bool "$DISABLE_DOT_EXPANSION"; then
if check-bool "$DOT_EXPANSION"; then
function expand-dot-to-parent-directory-path() {
if [[ $LBUFFER = *.. ]]; then
LBUFFER+=/..
@ -247,7 +247,7 @@ if ! check-bool "$DISABLE_DOT_EXPANSION"; then
fi
# Display an indicator when completing.
if ! check-bool "$DISABLE_COMPLETION_INDICATOR"; then
if check-bool "$COMPLETION_INDICATOR"; then
function expand-or-complete-prefix-with-indicator() {
echo -n "\e[31m...\e[0m"
zle expand-or-complete-prefix

View File

@ -69,7 +69,7 @@ autoload -Uz add-zsh-hook
# Sets the tab and window titles before the prompt is displayed.
function set-title-precmd {
if ! check-bool "$DISABLE_AUTO_TITLE"; then
if check-bool "$AUTO_TITLE"; then
set-window-title "${(%):-%~}"
for kind in tab screen; do
# Left-truncate the current working directory to 15 characters.
@ -81,7 +81,7 @@ add-zsh-hook precmd set-title-precmd
# Sets the tab and window titles before command execution.
function set-title-preexec {
if ! check-bool "$DISABLE_AUTO_TITLE"; then
if check-bool "$AUTO_TITLE"; then
set-title-by-command "$2"
fi
}