aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/zsh/.zshrc31
1 files changed, 18 insertions, 13 deletions
diff --git a/shell/zsh/.zshrc b/shell/zsh/.zshrc
index 261b166..96264ff 100644
--- a/shell/zsh/.zshrc
+++ b/shell/zsh/.zshrc
@@ -13,19 +13,24 @@ compinit
. ~/.dotfiles/shell/zsh/zsh-git-prompt/zshrc.sh
PROMPT='[%F{green}%n%f@%m %F{green}%~%f $(git_super_status)]$ '
-. ~/.dotfiles/shell/zsh/fzf/key-bindings.zsh
-
-. ~/.dotfiles/shell/zsh/broot.zsh
-
-. /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
-. /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-. /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
-
-bindkey '\e[1~' beginning-of-line # Home
-bindkey '\e[4~' end-of-line # End
-bindkey '\e[3~' delete-char # Delete
-bindkey '^[[A' history-substring-search-up # Up
-bindkey '^[[B' history-substring-search-down # Down
+[ -n "$(command -v fzf)" ] && . ~/.dotfiles/shell/zsh/fzf/key-bindings.zsh
+
+[ -n "$(command -v broot)" ] && . ~/.dotfiles/shell/zsh/broot.zsh
+
+SYSTEM_PLUGINS=(/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
+ /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+ /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh)
+for plugin in $SYSTEM_PLUGINS; do
+ [ -e "$plugin" ] && . $plugin
+done
+
+bindkey '\e[1~' beginning-of-line # Home
+bindkey '\e[4~' end-of-line # End
+bindkey '\e[3~' delete-char # Delete
+[ -n "$(command -v history-substring-search-up)" ] && \
+ bindkey '^[[A' history-substring-search-up # Up
+[ -n "$(command -v history-substring-search-down)" ] && \
+ bindkey '^[[B' history-substring-search-down # Down
bindkey '^[[1;5D' backward-word # Ctrl+Left
bindkey '^[[1;5C' forward-word # Ctrl+Right