Skip to content

Instantly share code, notes, and snippets.

@carlosm3011
Last active October 19, 2019 06:03
Show Gist options
  • Save carlosm3011/05d10c4801bdfecbacfa7c6a8323bfa6 to your computer and use it in GitHub Desktop.
Save carlosm3011/05d10c4801bdfecbacfa7c6a8323bfa6 to your computer and use it in GitHub Desktop.
Friendlier autocomplete for bash (mac, linux)
# set this parameter in .bashrc or .bash_profile
# Source: [See gist comments]
#bind 'set mark-symlinked-directories on'
# (Hopefully) For all readline-enabled processes
# If ~/.inputrc doesn't exist yet: First include the original /etc/inputrc
# so it won't get overriden
# if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi
# Add shell-option to ~/.inputrc to enable case-insensitive tab completion
# echo 'set completion-ignore-case On' >> ~/.inputrc
# Edit ~/.inputrc:
$include /etc/inputrc
set mark-symlinked-directories on
set completion-ignore-case On
@carlosm3011
Copy link
Author

carlosm3011 commented Jul 4, 2017

Friendlier Autocomplete Behaviour for Bash (MacOS, Linux)

Normal autocomplete for symlinks in bash

Have you noticed how TAB does not add the trailing "/" when autocompleting directory symlinks ? Does it annoy you as much as it annoys me?

Check: Symlink autocomplete at superuser.com

Make TAB autocomplete case insensitive

Should I use "checkouts" or "Checkouts", was it "Documents" or "documents". Jeez, why should I have to remember that? Under macOS this is even more annoying as bash TAB is case-sensitive but the underlying filesystem is not.

Thankfully there is a config knob for that:

set completion-ignore-case On

Rreference: Can I make tab autocompletion case insensitive?

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