if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then function zle-line-init() { echoti smkx } function zle-line-finish() { echoti rmkx } zle -N zle-line-init zle -N zle-line-finish fi bindkey -e bindkey '\ew' kill-region bindkey -s '\el' 'ls\n' bindkey '^r' history-incremental-search-backward [[ "${terminfo[kpp]}" != "" ]] && bindkey "${terminfo[kpp]}" up-line-or-history [[ "${terminfo[knp]}" != "" ]] && bindkey "${terminfo[knp]}" down-line-or-history if [[ "${terminfo[kcuu1]}" != "" ]]; then autoload -U up-line-or-beginning-search zle -N up-line-or-beginning-search bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search fi if [[ "${terminfo[kcud1]}" != "" ]]; then autoload -U down-line-or-beginning-search zle -N down-line-or-beginning-search bindkey "${terminfo[kcud1]}" down-line-or-beginning-search fi [[ "${terminfo[khome]}" != "" ]] && bindkey "${terminfo[khome]}" beginning-of-line [[ "${terminfo[kend]}" != "" ]] && bindkey "${terminfo[kend]}" end-of-line bindkey ' ' magic-space bindkey '^[[1;5C' forward-word bindkey '^[[1;5D' backward-word [[ "${terminfo[kcbt]}" != "" ]] && bindkey "${terminfo[kcbt]}" reverse-menu-complete bindkey '^?' backward-delete-char if [[ "${terminfo[kdch1]}" != "" ]]; then bindkey "${terminfo[kdch1]}" delete-char else bindkey "^[[3~" delete-char bindkey "^[3;5~" delete-char bindkey "\e[3~" delete-char fi autoload -U edit-command-line zle -N edit-command-line bindkey '\C-x\C-e' edit-command-line bindkey "^[m" copy-prev-shell-word