-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zlogin
executable file
·53 lines (42 loc) · 1.3 KB
/
.zlogin
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
52
53
#!/usr/bin/env zsh
# .zlogin
#
# startup file read in interactive login shells
#
# The following code helps us by optimizing the existing framework.
# This includes zcompile, zcompdump, etc.
#
(
# Function to determine the need of a zcompile. If the .zwc file
# does not exist, or the base file is newer, we need to compile.
# These jobs are asynchronous, and will not impact the interactive shell
function zcompare() {
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
zcompile ${1}
fi
}
setopt EXTENDED_GLOB
# zcompile the completion cache; siginificant speedup.
zcompare ${ZDOTDIR:-${HOME}}/.zcompdump
zcompare ${HOME}/.zshrc
zcompare ${HOME}/.zshrc.shared
# zcompile all .zsh files in the theme
for file in ${HOME}/.oh-my-zsh/custom/themes/powerlevel10k/**/*.zsh; do
zcompare ${file}
done
for file in ${HOME}/.oh-my-zsh/lib/*.zsh; do
zcompare ${file}
done
for file in ${HOME}/.oh-my-zsh/custom/plugins/*/*.zsh; do
zcompare ${file}
done
for file in ${HOME}/.oh-my-zsh/plugins/{common-aliases,git,git-extras,history-substring-search}/*.zsh; do
zcompare ${file}
done
) &!
# Load all files from .shellrc/login.d directory
if [ -d "${HOME}/.shellrc/login.d" ]; then
for file in ${HOME}/.shellrc/login.d/*.sh; do
source $file
done
fi