summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2018-12-19 20:52:59 +0100
committerAlan Pearce2018-12-19 20:52:59 +0100
commit025158e41a21a8d17346a5825258e0893093b492 (patch)
tree4a4c8419e7adbdb826f9d0d2a90056d4a4a4cd6b
parent9a9742dc4e7ad819de012ae00bbd4ee2784740c5 (diff)
downloadnixfiles-025158e41a21a8d17346a5825258e0893093b492.tar.lz
nixfiles-025158e41a21a8d17346a5825258e0893093b492.tar.zst
nixfiles-025158e41a21a8d17346a5825258e0893093b492.zip
zsh: cleanup
-rw-r--r--zsh/.config/zsh/.zshrc37
1 files changed, 14 insertions, 23 deletions
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
index e67955de..1e187e69 100644
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.config/zsh/.zshrc
@@ -136,11 +136,11 @@ zplugin ice blockf wait'0' lucid
 zplugin light "zsh-users/zsh-completions"
 zplugin ice wait'1' lucid
 zplugin light "hlissner/zsh-autopair"
-zplugin ice atload'alias kx=kubectx' cp'kube-aliases.plugin.zsh -> kube-aliases.zsh' atclone'sed -i s+"$ZSH_CUSTOM/plugins/zsh-kubernetes+$PWD+" kube-aliases.zsh' atpull'%atclone' pick'kube-aliases.zsh' nocompile
+zplugin ice atload'alias kx=kubectx' cp'kube-aliases.plugin.zsh -> kube.plugin.zsh' atclone'sed -i s+"$ZSH_CUSTOM/plugins/zsh-kubernetes+$PWD+" kube.plugin.zsh' atpull'%atclone' pick'kube.plugin.zsh'
 zplugin light "dbz/kube-aliases"
 zplugin ice wait'1' lucid atinit'alias cdg=cd-gitroot'
 zplugin load "mollifier/cd-gitroot"
-zplugin ice wait'1' lucid
+zplugin ice wait'[[ -n ${ZLAST_COMMANDS[(r)rm*]} ]]' lucid
 zplugin load "MikeDacre/careful_rm"
 
 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=7"
@@ -150,33 +150,23 @@ zplugin load "zsh-users/zsh-autosuggestions"
 zplugin ice wait'1' lucid
 zplugin light "arzzen/calc.plugin.zsh"
 
+# provides the title function and macOS title-folder sync
+zplugin ice if'[[ $os -eq darwin ]]'
 zplugin snippet "OMZ::lib/functions.zsh"
+zplugin ice if'[[ $os -eq darwin ]]'
 zplugin snippet "OMZ::lib/termsupport.zsh"
 
-if [[ $os -eq darwin ]]
-then
-  zplugin load "unixorn/tumult.plugin.zsh"
-fi
+zplugin ice if'[[ $os -eq darwin ]]' wait'1' lucid
+zplugin load "unixorn/tumult.plugin.zsh"
 
-if [[ -n $commands[npm] ]]
-then
-  zplugin light "lukechilds/zsh-better-npm-completion"
-fi
+zplugin ice wait'[[ -n ${ZLAST_COMMANDS[(r)npm*]} ]]' lucid
+zplugin light "lukechilds/zsh-better-npm-completion"
 
-if [[ -n $commands[yarn] ]]
-then
-  zplugin snippet "https://github.com/robbyrussell/oh-my-zsh/raw/master/plugins/yarn/yarn.plugin.zsh"
-fi
+zplugin ice wait'[[ -n ${ZLAST_COMMANDS[(r)nix*]} ]]' lucid
+zplugin light "spwhitt/nix-zsh-completions"
 
-if [[ -n $commands[nix-env] ]]
-then
-  zplugin light "spwhitt/nix-zsh-completions"
-fi
-
-if [[ -n $commands[ghq] ]]
-then
-  zplugin light "${GOPATH:=$HOME/go}/src/github.com/motemen/ghq/zsh"
-fi
+zplugin ice if'[[ -n $commands[ghq] ]]'
+zplugin light "${GOPATH:=$HOME/go}/src/github.com/motemen/ghq/zsh"
 
 if [[ -n $commands[gcloud] ]]
 then
@@ -258,3 +248,4 @@ unsetopt flow_control       # Let me use ^S and ^Q
 
 zplugin ice wait'1' lucid #atinit'zpcompinit; zpcdreplay -q'
 zplugin light "zdharma/fast-syntax-highlighting"
+