Created
October 15, 2025 18:42
-
-
Save robin-a-meade/bef67e898b37909dca81630f2129f419 to your computer and use it in GitHub Desktop.
Minimal bashrc with TAB:menu-complete and prefix history search using UP and DOWN arrow keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .bashrc | |
| # Source global definitions | |
| if [ -f /etc/bashrc ]; then | |
| . /etc/bashrc | |
| fi | |
| # User specific aliases and functions | |
| # Return immediately if not an interactive shell | |
| if [[ $- != *i* ]]; then return; fi | |
| # Support multi-line history entries well | |
| # https://stackoverflow.com/a/17194155 | |
| # https://unix.stackexchange.com/a/109035 | |
| shopt -s lithist | |
| shopt -s cmdhist | |
| # Configure TAB key to cycle through completion candidates | |
| # https://lists.gnu.org/archive/html/help-bash/2014-06/msg00002.html | |
| bind 'TAB:menu-complete' | |
| # Enable prefix history search using UP and DOWN arrow keys | |
| bind '"\e[A": history-search-backward' | |
| bind '"\e[B": history-search-forward' | |
| # Disable XON/XOFF flow control to free up Ctrl-S for forward-history-search | |
| stty -ixon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment