X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=shell%2Fzsh%2Frc;h=660430cc3789504c5433c4da0969c8927166a5c8;hp=0af99afb89db0be411dbaab526d462c16d5d6e08;hb=dab786b7775766e62acd77e57794d8425a5e6e35;hpb=36b6cdd7b9a67211fbb0a5a86819fb51fc4e3dfe diff --git a/shell/zsh/rc b/shell/zsh/rc index 0af99af..660430c 100644 --- a/shell/zsh/rc +++ b/shell/zsh/rc @@ -184,6 +184,13 @@ bindkey -a '^P' history-beginning-search-backward # binding for Vi-mode # after calling ^P. bindkey -a '^N' history-beginning-search-forward +# Use current input when pressing Ctrl-R. Thanks to Mikachu in #zsh on +# Freenode (2016-07-08 20:54 CEST). +zshrc-history-incremental-pattern-search-backward() { + zle .history-incremental-pattern-search-backward $BUFFER +} +zle -N history-incremental-pattern-search-backward \ + zshrc-history-incremental-pattern-search-backward # Enable incremental search which is especially useful when the string is an # argument and not the command. bindkey '^R' history-incremental-pattern-search-backward @@ -792,7 +799,6 @@ bindkey '^F' complete-files compdef slocate=locate compdef srsync=rsync compdef srsync-incremental=rsync -compdef svalgrind=valgrind compdef sc=systemctl @@ -849,7 +855,7 @@ alias -g S='| sort' alias -g SL='| sort | less' alias -g T='| tail' alias -g U='| uniq' -alias -g X='`xsel -p || xclip -o`' # X selection +alias -g X='-- "$(xsel -p || xclip -o)"' # X selection # Make going up directories simple. alias -g ...='../..'