1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-10-31 18:01:30 +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
MichaelAquilina/zsh-autoswitch-virtualenv
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/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/git
robbyrussell/oh-my-zsh path:plugins/golang
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/vi-mode
zdharma/fast-syntax-highlighting
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
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`
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
export ZSH="$(antibody path robbyrussell/oh-my-zsh)"