From 0b73d545946fa1d62a66138ad30e46cd0f8d358e Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Tue, 26 Mar 2019 10:50:50 +0100 Subject: Improve zsh bindings --- zsh/.zshrc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'zsh/.zshrc') diff --git a/zsh/.zshrc b/zsh/.zshrc index 5f20ad3..503bedb 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -2,6 +2,10 @@ [[ -z $DISPLAY && -z $SSH_CONNECTION && $XDG_VTNR -eq 1 ]] && exec startx # }}} ## Bindings {{{ + +# Load fzf bindings here because we will override ^r +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + bindkey -v bindkey -a 'k' history-beginning-search-backward bindkey -a 'j' history-beginning-search-forward @@ -17,6 +21,7 @@ bindkey '^k' kill-line bindkey '^u' kill-whole-line bindkey '^v' visual-mode bindkey '^w' backward-kill-word +bindkey '^r' history-incremental-search-backward autoload -z edit-command-line zle -N edit-command-line @@ -77,18 +82,15 @@ bindkey '^z' z ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' # }}} -## fzf {{{ - -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +## Use fzf with z {{{ -# Use fzf with z unalias z 2> /dev/null z() { [ $# -gt 0 ] && _z "$*" && return cd "$(_z -l 2>&1 | fzf --height 40% --reverse --inline-info +s --tac --query "$*" | sed 's/^[0-9,.]* *//')" zle && zle reset-prompt } -zle -N z +zle -N z # }}} ## Colors {{{ -- cgit v1.2.3