]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: Add global aliases N (>/dev/null) and EN (2>/dev/null).
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index 55e92424562027b001676243b47ea43594cc8aa3..f696a34f16efa20fe5bbf7d4c5c708e41ed498c5 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -601,6 +601,12 @@ bindkey '^F' complete-files
 # <nyh@math.technion.ac.il> for a fix (-r) to handle whitespace/quotes
 # correctly, both on the Zsh mailing list.
 TRAPINT() {
+    # Don't store this line in history if histignorespace is enabled and the
+    # line starts with a space.
+    if [[ -o histignorespace && ${BUFFER[1]} = " " ]]; then
+        return $1
+    fi
+
     # Store the current buffer in the history.
     zle && print -s -r -- $BUFFER
 
@@ -618,6 +624,8 @@ alias sudo='sudo '
 
 # Global aliases for often used redirections.
 alias -g E='2>&1'
+alias -g N='>/dev/null'
+alias -g EN='2>/dev/null'
 alias -g L='2>&1 | less'
 alias -g LS='2>&1 | less -S' # -S prevents wrapping of long lines
 alias -g D='2>&1 | colordiff | less'