Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 77 lines (64 sloc) 1.992 kb
7c94745 @vguerci [upgrade] before init (no reload needed unless oh-my-zsh.sh has been …
vguerci authored
1 # Check for updates on initial load...
9b4a89f Fix bug from Pull request #395
Michael Komitee authored
2 if [ "$DISABLE_AUTO_UPDATE" != "true" ]
7c94745 @vguerci [upgrade] before init (no reload needed unless oh-my-zsh.sh has been …
vguerci authored
3 then
c113e88 @toolbear Fix auto upgrade failure from non-exported ZSH env var
authored
4 /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh
7c94745 @vguerci [upgrade] before init (no reload needed unless oh-my-zsh.sh has been …
vguerci authored
5 fi
6
53abb4e @robbyrussell Moving the loading of all .zsh files into a different file so that we…
robbyrussell authored
7 # Initializes Oh My Zsh
8
b865f2a @kastner adding homebrew completions - and a function dir
kastner authored
9 # add a function path
1aacb74 add custom completion support
Guten authored
10 fpath=($ZSH/functions $ZSH/completions $fpath)
b865f2a @kastner adding homebrew completions - and a function dir
kastner authored
11
53abb4e @robbyrussell Moving the loading of all .zsh files into a different file so that we…
robbyrussell authored
12 # Load all of the config files in ~/oh-my-zsh that end in .zsh
13 # TIP: Add files you don't want in git to .gitignore
8debd09 @robbyrussell Moving all zsh config options into a lib/ subdirectory to make way fo…
robbyrussell authored
14 for config_file ($ZSH/lib/*.zsh) source $config_file
107322c @robbyrussell Moving some example files into custom/
robbyrussell authored
15
258457e @docwhat Moved ZSH_CUSTOM declaration before fpath is set
docwhat authored
16 # Set ZSH_CUSTOM to the path where your custom config files
17 # and plugins exists, or else we will use the default custom/
18 if [[ -z "$ZSH_CUSTOM" ]]; then
19 ZSH_CUSTOM="$ZSH/custom"
20 fi
21
4b3429d @arbovm fixing #812: adding plugins w/o plugin.zsh file to fpath.
arbovm authored
22
23 is_plugin() {
24 local base_dir=$1
25 local name=$2
26 test -f $base_dir/plugins/$name/$name.plugin.zsh \
27 || test -f $base_dir/plugins/$name/_$name
28 }
3512eca @docwhat set fpath correctly for custom plugins
docwhat authored
29 # Add all defined plugins to fpath. This must be done
30 # before running compinit.
31 for plugin ($plugins); do
4b3429d @arbovm fixing #812: adding plugins w/o plugin.zsh file to fpath.
arbovm authored
32 if is_plugin $ZSH_CUSTOM $plugin; then
3512eca @docwhat set fpath correctly for custom plugins
docwhat authored
33 fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
4b3429d @arbovm fixing #812: adding plugins w/o plugin.zsh file to fpath.
arbovm authored
34 elif is_plugin $ZSH $plugin; then
3512eca @docwhat set fpath correctly for custom plugins
docwhat authored
35 fpath=($ZSH/plugins/$plugin $fpath)
36 fi
37 done
3cf9ab7 @robbyrussell Initial implementation of a new plugin system, so that people can man…
robbyrussell authored
38
16ac094 @oknowton Moved compinit call back to oh-my-zsh.sh, after plugins are loaded
oknowton authored
39 # Load and run compinit
40 autoload -U compinit
41 compinit -i
eddab50 @evansj run update check *after* running custom configuration scripts.
evansj authored
42
3780247 @kibs added option of setting another path to custom plugins and files
kibs authored
43
3cf9ab7 @robbyrussell Initial implementation of a new plugin system, so that people can man…
robbyrussell authored
44 # Load all of the plugins that were defined in ~/.zshrc
796f516 @oknowton Minor reformatting
oknowton authored
45 for plugin ($plugins); do
3780247 @kibs added option of setting another path to custom plugins and files
kibs authored
46 if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
47 source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
f8aae64 @theunraveler Adding ability to override plugins from the custom directory.
theunraveler authored
48 elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
6bf906a @oknowton Optimize plugin loading so that only one call to compinit is required
oknowton authored
49 source $ZSH/plugins/$plugin/$plugin.plugin.zsh
50 fi
51 done
52
58a7cf1 @oknowton Move sourcing of custom to below plugins
oknowton authored
53 # Load all of your custom configurations from custom/
3780247 @kibs added option of setting another path to custom plugins and files
kibs authored
54 for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
3cf9ab7 @robbyrussell Initial implementation of a new plugin system, so that people can man…
robbyrussell authored
55
8294cf4 Postponing sourcing of the theme until after local customizations
Michael Komitee authored
56 # Load the theme
6f7d51c @robbyrussell Feature: Random themes now supported. Just set your theme to 'random'…
robbyrussell authored
57 if [ "$ZSH_THEME" = "random" ]
58 then
59 themes=($ZSH/themes/*zsh-theme)
60 N=${#themes[@]}
5c1b341 @watsoncj Fix to random theme selection
watsoncj authored
61 ((N=(RANDOM%N)+1))
6f7d51c @robbyrussell Feature: Random themes now supported. Just set your theme to 'random'…
robbyrussell authored
62 RANDOM_THEME=${themes[$N]}
63 source "$RANDOM_THEME"
64 echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
65 else
527355e @mhitza When the theme choice is left out, oh-my-zsh will not try to load it
mhitza authored
66 if [ ! "$ZSH_THEME" = "" ]
67 then
2ca2ad3 @fracek First search in the custom folder for the theme
fracek authored
68 if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ]
69 then
70 source "$ZSH/custom/$ZSH_THEME.zsh-theme"
71 else
72 source "$ZSH/themes/$ZSH_THEME.zsh-theme"
73 fi
527355e @mhitza When the theme choice is left out, oh-my-zsh will not try to load it
mhitza authored
74 fi
6f7d51c @robbyrussell Feature: Random themes now supported. Just set your theme to 'random'…
robbyrussell authored
75 fi
76
Something went wrong with that request. Please try again.