mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Clean up appearance lib file and redundant colors calls in other files
This commit is contained in:
parent
51946eb3ce
commit
2193135ebc
13 changed files with 12 additions and 39 deletions
|
|
@ -69,17 +69,17 @@ function precmd {
|
|||
#Choose from all databases, regardless of whether they are considered "offensive"
|
||||
fortune -a
|
||||
}
|
||||
#obtains the tip
|
||||
#obtains the tip
|
||||
ps1_command_tip () {
|
||||
wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d'
|
||||
}
|
||||
}
|
||||
prompt_header () {
|
||||
if [[ "true" == "$ENABLE_COMMAND_TIP" ]]; then
|
||||
ps1_command_tip
|
||||
else
|
||||
ps1_fortune
|
||||
fi
|
||||
}
|
||||
fi
|
||||
}
|
||||
PROMPT_HEAD="${RED_START}${PR_YELLOW}$(prompt_header)${PR_RESET}"
|
||||
# set a simple variable to show when in screen
|
||||
if [[ -n "${WINDOW}" ]]; then
|
||||
|
|
@ -99,11 +99,8 @@ prompt_context () {
|
|||
set_prompt () {
|
||||
# required for the prompt
|
||||
setopt prompt_subst
|
||||
autoload colors zsh/terminfo
|
||||
if [[ "$terminfo[colors]" -gt 8 ]]; then
|
||||
colors
|
||||
fi
|
||||
|
||||
autoload zsh/terminfo
|
||||
|
||||
# ######### PROMPT #########
|
||||
PROMPT='${PROMPT_HEAD}
|
||||
${RED_START}$(prompt_context)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ get_git_dirty() {
|
|||
}
|
||||
|
||||
autoload -Uz vcs_info
|
||||
autoload -U colors && colors
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
|
||||
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
# Based on bira theme
|
||||
|
||||
# load some modules
|
||||
autoload -U colors zsh/terminfo # Used in the colour alias below
|
||||
colors
|
||||
autoload -U zsh/terminfo # Used in the colour alias below
|
||||
setopt prompt_subst
|
||||
|
||||
# make some aliases for the colours: (could use normal escape sequences too)
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ function virtualenv_info {
|
|||
PR_GIT_UPDATE=1
|
||||
|
||||
setopt prompt_subst
|
||||
autoload colors
|
||||
colors
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
|
|
|||
|
|
@ -44,10 +44,7 @@ setprompt () {
|
|||
###
|
||||
# See if we can use colors.
|
||||
|
||||
autoload colors zsh/terminfo
|
||||
if [[ "$terminfo[colors]" -ge 8 ]]; then
|
||||
colors
|
||||
fi
|
||||
autoload zsh/terminfo
|
||||
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do
|
||||
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
|
||||
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
autoload -U colors && colors
|
||||
|
||||
autoload -Uz vcs_info
|
||||
|
||||
zstyle ':vcs_info:*' stagedstr '%F{green}●'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
setopt prompt_subst
|
||||
autoload colors
|
||||
colors
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
|
|
|||
|
|
@ -63,10 +63,7 @@ setprompt () {
|
|||
###
|
||||
# See if we can use colors.
|
||||
|
||||
autoload colors zsh/terminfo
|
||||
if [[ "$terminfo[colors]" -ge 8 ]]; then
|
||||
colors
|
||||
fi
|
||||
autoload zsh/terminfo
|
||||
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
|
||||
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
|
||||
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ function virtualenv_info {
|
|||
PR_GIT_UPDATE=1
|
||||
|
||||
setopt prompt_subst
|
||||
autoload colors
|
||||
colors
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
autoload -U colors && colors
|
||||
|
||||
autoload -Uz vcs_info
|
||||
|
||||
zstyle ':vcs_info:*' stagedstr '%F{green}●'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue