-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathomz-themes-standalone.zsh
More file actions
51 lines (44 loc) · 1.48 KB
/
omz-themes-standalone.zsh
File metadata and controls
51 lines (44 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
### make sure we have OMZ set up
ZSH="${ZSH:-${0:A:h}/.ohmyzsh}"
[[ -d $ZSH ]] || git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh "$ZSH"
### omz theme lib dependencies
typeset -f bzr_prompt_info > /dev/null || source "$ZSH"/lib/bzr.zsh
typeset -f git_prompt_info > /dev/null || source "$ZSH"/lib/git.zsh
typeset -f nvm_prompt_info > /dev/null || source "$ZSH"/lib/nvm.zsh
typeset -f ruby_prompt_info > /dev/null || source "$ZSH"/lib/prompt_info_functions.zsh
source "$ZSH"/lib/theme-and-appearance.zsh
### omz theme plugin dependencies
# lots of themes use the battery plugin
typeset -f battery_pct_prompt > /dev/null || source "$ZSH"/plugins/battery/battery.plugin.zsh
# some themes require this function from the git plugin
function work_in_progress() {
if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
echo "WIP!!"
fi
}
function set_omz_prompt {
local theme=$1
[[ -f $ZSH/themes/${theme}.zsh-theme ]] || return 1
ZSH_THEME=$theme
# themes are bad at reseting themselves, so let's help out by resetting to
# zsh defaults before applying a new theme
PROMPT='%n@%m %1~ %# '
PROMPT2='%_> '
PROMPT3='?# '
PROMPT4='+%N:%i> '
PS1=$PROMPT
PS2=$PROMPT2
PS3=$PROMPT3
PS4=$PROMPT4
SPROMPT='zsh: correct ''%R'' to ''%r'' [nyae]? '
RPROMPT=''
RPS1=''
# set the theme
source $ZSH/themes/$ZSH_THEME.zsh-theme
}
fpath+="${0:A:h}/themes"
if ! typeset -f promptinit > /dev/null; then
autoload -U promptinit
fi
promptinit
prompt ${ZSH_THEME:-robbyrussell}