mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge remote-tracking branch 'origin/theming'
Merging in the refactored theming since we no longer rely on ZSH_THEME variable anymore Conflicts: oh-my-zsh.zsh templates/zshrc.arch-zsh-template templates/zshrc.zsh-template
This commit is contained in:
commit
f838ca5e1f
4 changed files with 45 additions and 19 deletions
11
lib/theming.zsh
Normal file
11
lib/theming.zsh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
set_theme() {
|
||||
source "$ZSH/themes/$1.zsh-theme"
|
||||
}
|
||||
|
||||
random_theme() {
|
||||
local themes
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
source "$themes[$RANDOM%$#themes+1]"
|
||||
}
|
||||
|
||||
# compdef "_files -g '*.zsh'" set_theme
|
||||
|
|
@ -44,21 +44,6 @@ for plugin ($plugins); do
|
|||
fi
|
||||
done
|
||||
|
||||
local ZSH_THEME
|
||||
zstyle -a :omz:style theme ZSH_THEME
|
||||
|
||||
# Load the theme
|
||||
if [ "$ZSH_THEME" = "random" ]
|
||||
then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
source "$RANDOM_THEME"
|
||||
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
||||
else
|
||||
if [ ! "$ZSH_THEME" = "" ]
|
||||
then
|
||||
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
||||
fi
|
||||
fi
|
||||
local theme
|
||||
zstyle -a :omz:style theme theme
|
||||
set_theme theme
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ fi
|
|||
|
||||
# Functions #################################################################
|
||||
|
||||
# https://github.com/dbb
|
||||
# https://github.com/dbb
|
||||
|
||||
|
||||
# empty_gh [NAME_OF_REPO]
|
||||
|
|
|
|||
30
templates/zshrc.zsh-template
Normal file
30
templates/zshrc.zsh-template
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Path to your oh-my-zsh configuration.
|
||||
ZSH=$HOME/.oh-my-zsh
|
||||
|
||||
# Set to this to use case-sensitive completion
|
||||
# CASE_SENSITIVE="true"
|
||||
|
||||
# Comment this out to disable weekly auto-update checks
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment following line if you want to disable colors in ls
|
||||
# DISABLE_LS_COLORS="true"
|
||||
|
||||
# Uncomment following line if you want to disable autosetting terminal title.
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
|
||||
# Uncomment following line if you want red dots to be displayed while waiting for completion
|
||||
# COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
plugins=(git)
|
||||
|
||||
source $ZSH/oh-my-zsh.zsh
|
||||
|
||||
# Load a theme
|
||||
# Look in $ZSH/themes/
|
||||
set_theme "robbyrussell"
|
||||
# random_theme
|
||||
|
||||
# Customize to your needs...
|
||||
Loading…
Add table
Add a link
Reference in a new issue