zsh 4.3.10 from Squeeze needs some more magic to make it work
[abe:zshrc.git] / zsh.d / 07-grml-bindkey
1 # -*- sh -*-
2 # Removes bindkey ' '   magic-space    # also do history expansion on space
3 bindkey ' ' self-insert
4
5 # History filtering on cursor-up with prefix on the commandline
6 autoload -Uz history-search-end
7
8 if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
9     function zle-line-init () {
10         printf '%s' ${terminfo[smkx]}
11     }
12     function zle-line-finish () {
13         printf '%s' ${terminfo[rmkx]}
14     }
15     zle -N zle-line-init
16     zle -N zle-line-finish
17 fi
18
19 zle -N history-beginning-search-backward-end history-search-end
20 zle -N history-beginning-search-forward-end history-search-end
21 bindkey "${terminfo[kcuu1]}" history-beginning-search-backward-end
22 bindkey "${terminfo[kcud1]}" history-beginning-search-forward-end