about summary refs log tree commit diff
path: root/zsh/.zlogin
blob: 350d06644da45c24f9bee587e7035b59f7dcc0b7 (plain) (blame)
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
#!/usr/bin/env zsh

(
    autoload -U zrecompile

    lazy_zrecompile()
    {
        if [[ -s "${1}" && ( ! -s "${1}.zwc" || "${1}" -nt "${1}.zwc" ) ]]
        then
            zrecompile -pq "${1}"
        fi
    }

    FLIST=(
        ${ZCOMPDUMP}
        ${ZLOGIN}
        ${ZLOGOUT}
        ${ZPROFILE}
        ${ZSHENV}
        ${ZSHRC}
        ${HOME}/.zsh.d/*.zsh
    )

    for i in ${FLIST}
    do
        lazy_zrecompile "${i}"
    done
) &!

Consider giving Nix/NixOS a try! <3