zsh/85-keybindings.zsh

34 lines
871 B
Bash

# shellcheck shell=bash
# vim: ft=sh
# [Esc] [Esc]
bindkey '\e\e' send-break
# Navi
if command -v navi > /dev/null 2>&1; then
zinit snippet https://github.com/denisidoro/navi/blob/master/shell/navi.plugin.zsh
function magic-ctrl-g {
if ! (( $#BUFFER )) && [[ "$CONTEXT" == start ]]; then _navi_widget; fi
}
zle -N magic-ctrl-g
bindkey '^G' magic-ctrl-g
fi
# FZF #{{{
function magic-ctrl-f {
if ! (( $#BUFFER )) && [[ "$CONTEXT" == start ]]; then fzf-file-widget; fi
}
zle -N magic-ctrl-f
bindkey '^F' magic-ctrl-f
bindkey "^[[A" fzf-history-widget # Up
bindkey "^[[B" fzf-history-widget # Down
bindkey "${terminfo[kcuu1]}" fzf-history-widget # Up
bindkey "${terminfo[kcud1]}" fzf-history-widget # Down
#}}}
function magic-ctrl-z {
if ! (( $#BUFFER )) && [[ "$CONTEXT" == start ]]; then znt-kill-widget; fi
}
zle -N magic-ctrl-z
bindkey '^Z' magic-ctrl-z