Skip to content

Instantly share code, notes, and snippets.

@lucarin91
Last active August 28, 2018 08:44
Show Gist options
  • Save lucarin91/18c4c4636eae4175c9253a127c29a2ec to your computer and use it in GitHub Desktop.
Save lucarin91/18c4c4636eae4175c9253a127c29a2ec to your computer and use it in GitHub Desktop.
The .inputrc configuration file to enable a zsh-like completion mechanism in bash.
##
# The .inputrc configuration file to enable a zsh-like completion mechanism in bash.
# Features:
# - Press tab to cycle throw all possible completions in a case-insensitive fashion.
# - Use the up and down arrow to search throw the history for all matches of the typed string.
#
# DISCLAIMER: Use only when you cannot install zsh :)
#
# Put together by lucarin91.
##
# If set to ‘on’, Readline performs filename matching and completion in a case-insensitive fashion.
set completion-ignore-case on
# This alters the default behaviour of the completion functions. If set to ‘on’, words which have
# more than one possible completion cause the matches to be listed immediately instead of ringing the bell.
set show-all-if-ambiguous on
# Map tab to cycle through all the possible completions.
TAB: menu-complete
# Map up-arrow and down-arrow to allow the search for completions to the current line from your history.
# e.g. type “git” and then hit control-p to cycle through all the recent git commands.
"\e[A":history-search-backward
"\e[B":history-search-forward
@lucarin91
Copy link
Author

lucarin91 commented Aug 27, 2018

To "install" the configuration just put the file .inputrc inside your home directory.
In a single command:

mv .inputrc .inputrc.backup; curl -O https://gist.githubusercontent.com/lucarin91/18c4c4636eae4175c9253a127c29a2ec/raw/f62c589431feb168845ecabae36b81994bafa29b/.inputrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment