This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing> | |
# Open source under MIT LICENSE. | |
lazy_load() { | |
# Act as a stub to another shell function/command. When first run, it will load the actual function/command then execute it. | |
# E.g. This made my zsh load 0.8 seconds faster by loading `nvm` when "nvm", "npm" or "node" is used for the first time | |
# $1: space separated list of alias to release after the first load | |
# $2: file to source | |
# $3: name of the command to run after it's loaded | |
# $4+: argv to be passed to $3 |