diff --git a/lib/theming.zsh b/lib/theming.zsh new file mode 100644 index 000000000..96d93cef2 --- /dev/null +++ b/lib/theming.zsh @@ -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 diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 779021369..d235e1fd4 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -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 diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 9b0d54602..82f9f9e58 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -6,7 +6,7 @@ fi # Functions ################################################################# -# https://github.com/dbb +# https://github.com/dbb # empty_gh [NAME_OF_REPO] diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template new file mode 100644 index 000000000..bbec3a9d2 --- /dev/null +++ b/templates/zshrc.zsh-template @@ -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...