dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit e861f5c29aa82f08bfc82ec194caf76985b21ac9
parent 4f00aa083a4b64ac61331ebd81dd711f8848af2a
Author: Paco Esteban <paco@onna.be>
Date:   Thu, 18 Apr 2019 11:13:32 +0200

Better handling of include files on zsh

fzf completion and checking for existence of commands before loading

Diffstat:
zsh/.zsh/includes.zsh | 30+++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/zsh/.zsh/includes.zsh b/zsh/.zsh/includes.zsh @@ -1,10 +1,12 @@ # plenv -if which plenv > /dev/null; then eval "$(plenv init - zsh)"; fi +if command -v plenv > /dev/null; then eval "$(plenv init - zsh)"; fi # gcloud completion -if [ -f $HOME/etc/google-cloud-sdk/completion.zsh.inc ]; then - source $HOME/etc/google-cloud-sdk/completion.zsh.inc - source $HOME/.zsh/gcloud_helpers.zsh +if [ $commands[gcloud] ]; then + if [ -f $HOME/etc/google-cloud-sdk/completion.zsh.inc ]; then + source $HOME/etc/google-cloud-sdk/completion.zsh.inc + source $HOME/.zsh/gcloud_helpers.zsh + fi fi # nice 'x' command for all kinds of compressed file extraction @@ -14,18 +16,20 @@ fi [ -f $HOME/.zsh_plugins/colored-man-pages.plugin.zsh ] && source $HOME/.zsh_plugins/colored-man-pages.plugin.zsh # fzf stuff -if [ -f /usr/share/fzf/key-bindings.zsh ]; then - source /usr/share/fzf/key-bindings.zsh -elif [ -f $HOME/etc/fzf/key-bindings.zsh ]; then - source $HOME/etc/fzf/key-bindings.zsh +if [ $commands[fzf] ]; then + if [ -f /usr/share/fzf/key-bindings.zsh ]; then + source /usr/share/fzf/key-bindings.zsh + elif [ -f $HOME/etc/fzf/key-bindings.zsh ]; then + source $HOME/etc/fzf/key-bindings.zsh + fi + if [ -f /usr/share/fzf/completion.zsh ]; then + source /usr/share/fzf/completion.zsh + elif [ -f $HOME/etc/fzf/completion.zsh ]; then + source $HOME/etc/fzf/completion.zsh + fi else bindkey '^R' history-incremental-search-backward fi -if [ -f /usr/share/fzf/completion.zsh ]; then - source /usr/share/fzf/completion.zsh -elif [ -f $HOME/etc/fzf/completion.zsh ]; then - source $HOME/etc/fzf/completion.zsh -fi # kubectl completion and nice kube info on prompt if [ $commands[kubectl] ]; then