summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2019-03-26 10:50:50 +0100
committerUrbain Vaes <urbain@vaes.uk>2019-03-26 10:50:50 +0100
commit0b73d545946fa1d62a66138ad30e46cd0f8d358e (patch)
tree0870d8ae7a75876f5643388b99ed5b1874837ee6 /zsh
parent3f04df2fc99e6cbee9e5f8b0ed98fbb91d95f31b (diff)
Improve zsh bindings
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zshrc12
1 files changed, 7 insertions, 5 deletions
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 {{{