# Readline config (bash line editing + any readline program: python, psql...).
# Set via $INPUTRC; see shell/exports. zsh ignores this (uses ZLE); its
# equivalent prefix-search bindings live in zsh/.zshrc.
#
# Pull in distro defaults; a custom INPUTRC otherwise replaces them entirely.
$include /etc/inputrc

# zsh-style prefix history search: type a prefix, Up/Down walk matching
# history entries with cursor at END of line. Empty prefix = previous/next.
#
# Readline's history-search-* leaves the cursor at the prefix boundary, not the
# end (that's why zsh needs its history-search-end widget). There's no built-in
# "search then go to end", so: bind the real functions to throwaway keys, then
# bind the arrows to a MACRO that runs the search and then end-of-line (\C-e).
"\C-x\C-p": history-search-backward
"\C-x\C-n": history-search-forward
"\e[A": "\C-x\C-p\C-e"
"\e[B": "\C-x\C-n\C-e"
"\eOA": "\C-x\C-p\C-e"
"\eOB": "\C-x\C-n\C-e"
