summaryrefslogtreecommitdiffstats
path: root/zsh/.zlogin
diff options
context:
space:
mode:
authorAmin Bandali <amin@aminb.org>2017-04-27 09:20:32 -0400
committerAmin Bandali <amin@aminb.org>2017-04-27 09:20:32 -0400
commit855ca24386a69957e9449ba3d53e549cfeb11c87 (patch)
treec7fd375f1fc07c4610963aea9707c36741c2f1b7 /zsh/.zlogin
parent5ee38ac2b3d22d617605185087c74db0f6a40091 (diff)
downloadconfigs-855ca24386a69957e9449ba3d53e549cfeb11c87.tar.gz
configs-855ca24386a69957e9449ba3d53e549cfeb11c87.tar.xz
configs-855ca24386a69957e9449ba3d53e549cfeb11c87.zip
New setup
This was sitting uncommitted locally for a while, thought it was time to commit it and push it.
Diffstat (limited to '')
-rw-r--r--zsh/.zlogin59
1 files changed, 59 insertions, 0 deletions
diff --git a/zsh/.zlogin b/zsh/.zlogin
new file mode 100644
index 0000000..d8b5b0a
--- /dev/null
+++ b/zsh/.zlogin
@@ -0,0 +1,59 @@
+
+
+#
+# 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
+ zcompare() {
+ if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
+ zcompile ${1}
+ fi
+ }
+
+ zim_mods=${ZDOTDIR:-${HOME}}/.zim/modules
+ setopt EXTENDED_GLOB
+
+ # zcompile the completion cache; siginificant speedup.
+ for file in ${ZDOTDIR:-${HOME}}/.zcomp^(*.zwc)(.); do
+ zcompare ${file}
+ done
+
+ # zcompile .zshrc
+ zcompare ${ZDOTDIR:-${HOME}}/.zshrc
+
+ # zcompile some light module init scripts
+ zcompare ${zim_mods}/git/init.zsh
+ zcompare ${zim_mods}/utility/init.zsh
+ zcompare ${zim_mods}/pacman/init.zsh
+ zcompare ${zim_mods}/spectrum/init.zsh
+ zcompare ${zim_mods}/completion/init.zsh
+ zcompare ${zim_mods}/fasd/init.zsh
+
+ # zcompile all .zsh files in the custom module
+ for file in ${zim_mods}/custom/**/^(README.md|*.zwc)(.); do
+ zcompare ${file}
+ done
+
+ # zcompile all autoloaded functions
+ for file in ${zim_mods}/**/functions/^(*.zwc)(.); do
+ zcompare ${file}
+ done
+
+ # syntax-highlighting
+ for file in ${zim_mods}/syntax-highlighting/external/highlighters/**/*.zsh; do
+ zcompare ${file}
+ done
+ zcompare ${zim_mods}/syntax-highlighting/external/zsh-syntax-highlighting.zsh
+
+ # zsh-histery-substring-search
+ zcompare ${zim_mods}/history-substring-search/external/zsh-history-substring-search.zsh
+
+
+) &! \ No newline at end of file