perf(zsh): Load time decreased from 350ms to 110ms

- Read .profile in ~/.zshenv: ensuring non-login & non-interactive shell
  gets env set
- Comments on every zsh and zinit config
- Async load Zinit plugins
- Remove unnecessary plugins
- Create completion dumpfile once a day max
This commit is contained in:
Pratik Tripathy
2024-12-10 20:00:46 +05:30
parent 5c9929e1a0
commit 39bd3442d3
2 changed files with 65 additions and 59 deletions

10
common/.zshenv Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/zsh
# https://blog.patshead.com/2011/04/improve-your-oh-my-zsh-startup-time-maybe.html
skip_global_compinit=1
# https://github.com/sorin-ionescu/prezto/blob/master/runcoms/zshenv
# Ensure that a non-login, non-interactive shell has a defined environment.
if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.profile" ]]; then
source "${ZDOTDIR:-$HOME}/.profile"
fi