# ~/.inputrc - readline configuration for bash (wlanpi-shell-config)
# Layers on top of the global /etc/inputrc (Debian defaults + pi-gen tweaks).

$include /etc/inputrc

#-----------------------------------------
# HISTORY SEARCH WITH ARROW KEYS
#-----------------------------------------
# Map up/down arrows to search history based on what you've already typed
# Example: Type "ssh" then press Up to cycle through all ssh commands
"\e[A": history-search-backward
"\e[B": history-search-forward

# Ctrl+P and Ctrl+N for the same functionality
"\C-p": history-search-backward
"\C-n": history-search-forward

#-----------------------------------------
# COPY & PASTE
#-----------------------------------------
# Keep bracketed paste on explicitly so pasted multi-line/indented text is
# not executed immediately or mangled by the shell.
set enable-bracketed-paste on

#-----------------------------------------
# TAB COMPLETION BEHAVIOR
#-----------------------------------------
# Make Tab autocomplete regardless of filename case
set completion-ignore-case on

# Treat hyphens and underscores as equivalent when completing
set completion-map-case on

# Show all completions immediately (don't need to press Tab twice)
set show-all-if-ambiguous on

# Append a slash to completed directory names
set mark-directories on
set mark-symlinked-directories on

# Don't show hidden files unless the pattern explicitly begins with a dot
set match-hidden-files off

# Show completion matches in color (uses LS_COLORS)
set colored-stats on
set colored-completion-prefix on

# Show file type indicators (*/=>@|) in completion
set visible-stats on

# Immediately show all possible completions on first Tab press
set show-all-if-unmodified on

# Show extra info about completion matches
set completion-query-items 200

# Be more intelligent when autocompleting by also looking at the text after
# the cursor.
set skip-completed-text on

#-----------------------------------------
# BETTER EDITING EXPERIENCE
#-----------------------------------------
# Allow UTF-8 input and output
set input-meta on
set output-meta on
set convert-meta off

# Don't ring bell on completion
set bell-style none