]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: add completion for my wrapper scripts
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index 9e8edd262f67197c44ab3441b53a655f5987f044..ece0a2d67bacbf5fcbaa254578c8dfc9de4fa2ae 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -153,6 +153,7 @@ setopt incappendhistory
 setopt histignoredups
 # Don't add lines starting with a space to the history.
 setopt histignorespace
+
 # Vim like completions of previous executed commands (also enter Vi-mode). If
 # called at the beginning it just recalls old commands (like cursor up), if
 # called after typing something, only lines starting with the typed text are
@@ -181,6 +182,16 @@ bindkey -a '^P' history-beginning-search-backward # binding for Vi-mode
 # after calling ^P.
 bindkey -a '^N' history-beginning-search-forward
 
+# Enable incremental search which is especially useful when the string is an
+# argument and not the command.
+bindkey '^R' history-incremental-search-backward
+# Also enable my usual use of Ctrl-P/Ctrl-N to get the previous/next matching
+# history entry.
+if [[ $ZSH_VERSION == (4.<4->*|<5->*) ]]; then
+    bindkey -M isearch '^P' history-incremental-search-backward
+    bindkey -M isearch '^N' history-incremental-search-forward
+fi
+
 # Automatically push cd-ed directories on the directory stack.
 setopt autopushd
 # Don't push duplicates on the directory stack.
@@ -723,6 +734,12 @@ zle -C complete-files complete-word _generic
 zstyle ':completion:complete-files:*' completer _files
 bindkey '^F' complete-files
 
+# Completion for my wrapper scripts
+compdef slocate=locate
+compdef srsync=rsync
+compdef srsync-incremental=rsync
+compdef svalgrind=valgrind
+
 
 # CUSTOM ALIASES AND FUNCTIONS