1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-24 12:31:31 +01:00

zsh: remove slow-loading plugins

This commit is contained in:
bretello 2021-10-07 19:29:21 +02:00
parent b6c078fbfe
commit a68284cbcc
2 changed files with 30 additions and 6 deletions

View File

@ -1,21 +1,24 @@
# vim:ft=zsh
djui/alias-tips djui/alias-tips
MichaelAquilina/zsh-autoswitch-virtualenv MichaelAquilina/zsh-autoswitch-virtualenv
robbyrussell/oh-my-zsh robbyrussell/oh-my-zsh
robbyrussell/oh-my-zsh path:plugins/bgnotify #robbyrussell/oh-my-zsh path:plugins/bgnotify
robbyrussell/oh-my-zsh path:plugins/colored-man-pages robbyrussell/oh-my-zsh path:plugins/colored-man-pages
robbyrussell/oh-my-zsh path:plugins/common-aliases robbyrussell/oh-my-zsh path:plugins/common-aliases
robbyrussell/oh-my-zsh path:plugins/docker
robbyrussell/oh-my-zsh path:plugins/docker-compose
robbyrussell/oh-my-zsh path:plugins/fzf robbyrussell/oh-my-zsh path:plugins/fzf
robbyrussell/oh-my-zsh path:plugins/git robbyrussell/oh-my-zsh path:plugins/git
robbyrussell/oh-my-zsh path:plugins/golang robbyrussell/oh-my-zsh path:plugins/golang
robbyrussell/oh-my-zsh path:plugins/grc robbyrussell/oh-my-zsh path:plugins/grc
robbyrussell/oh-my-zsh path:plugins/pip
robbyrussell/oh-my-zsh path:plugins/pyenv
robbyrussell/oh-my-zsh path:plugins/pylint
robbyrussell/oh-my-zsh path:plugins/sudo robbyrussell/oh-my-zsh path:plugins/sudo
robbyrussell/oh-my-zsh path:plugins/vi-mode robbyrussell/oh-my-zsh path:plugins/vi-mode
zdharma/fast-syntax-highlighting zdharma/fast-syntax-highlighting
zsh-users/zsh-autosuggestions zsh-users/zsh-autosuggestions
zsh-users/zsh-completions zsh-users/zsh-completions
joshskidmore/zsh-fzf-history-search joshskidmore/zsh-fzf-history-search
##The following plugins are lazily loaded by lazy_load_omz_plugins
# robbyrussell/oh-my-zsh path:plugins/docker
# robbyrussell/oh-my-zsh path:plugins/docker-compose
# robbyrussell/oh-my-zsh path:plugins/pip
# robbyrussell/oh-my-zsh path:plugins/pyenv
# robbyrussell/oh-my-zsh path:plugins/pylint

View File

@ -31,6 +31,27 @@ if [[ "$(command -v dvc )" ]]; then
eval `dvc completion --shell zsh` eval `dvc completion --shell zsh`
fi fi
function lazy_load_omz_plugins {
# Lazily load omz plugins defined below when they are first invoked.
# This speeds up zsh loading time and reduces bloat whenever they are
# not used
#
local cmds=(docker docker-compose kubectl pip pylint)
local omz="robbyrussell/oh-my-zsh path:plugins"
local cmd
for cmd in $cmds ; do
if (( $+commands[$cmd] )) ; then
alias $cmd="antibody bundle ${omz}/${cmd} && unalias ${cmd} && $cmd"
fi
done
}
#lazy_load_omz_plugins
# Setup oh-my-zsh path # Setup oh-my-zsh path
export ZSH="$(antibody path robbyrussell/oh-my-zsh)" export ZSH="$(antibody path robbyrussell/oh-my-zsh)"