summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/npm/npm.plugin.zsh7
-rw-r--r--plugins/vi-mode/vi-mode.plugin.zsh7
2 files changed, 12 insertions, 2 deletions
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
index 30b91ec9c..02e4f3e93 100644
--- a/plugins/npm/npm.plugin.zsh
+++ b/plugins/npm/npm.plugin.zsh
@@ -2,10 +2,13 @@
__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
- npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE
+ npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null
+ [[ $? -ne 0 ]] && rm -f $__NPM_COMPLETION_FILE
fi
- source $__NPM_COMPLETION_FILE
+ [[ -f $__NPM_COMPLETION_FILE ]] && source $__NPM_COMPLETION_FILE
+
+ unset __NPM_COMPLETION_FILE
}
# Install dependencies globally
diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
index 0e2af5dce..dee694b9a 100644
--- a/plugins/vi-mode/vi-mode.plugin.zsh
+++ b/plugins/vi-mode/vi-mode.plugin.zsh
@@ -28,6 +28,13 @@ bindkey '^?' backward-delete-char
bindkey '^h' backward-delete-char
bindkey '^w' backward-kill-word
+# allow ctrl-r to perform backward search in history
+bindkey '^r' history-incremental-search-backward
+
+# allow ctrl-a and ctrl-e to move to beginning/end of line
+bindkey '^a' beginning-of-line
+bindkey '^e' end-of-line
+
# if mode indicator wasn't setup by theme, define default
if [[ "$MODE_INDICATOR" == "" ]]; then
MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"