2

I've been getting close to bash on finding the really nice features of Bash-it.

I want to be able (or so I think) to key ls file, and on pressing Tab ↹, i get a list of dotfiles, or the single one that matches, as below, using the bash-it autocomplete, and other plugins and aliases.

~ ls Tab ↹
Apps/                                                     Music/
bin/                                                      notes
conky-grapes-master/                                      Pictures/
cpu_power.sh*                                             Projects/
cpu_temp.sh*                                              Public/
Desktop/                                                  snap/
disk_pct_used.sh*                                         src/
Documents/                                                Downloads/
vmpk.sh*
dessert
  • 40,956

1 Answers1

3

There’s a Readline variable for that:

match-hidden-files

This variable, when set to ‘on’, causes Readline to match files whose names begin with a ‘.’ (hidden files) when performing filename completion. If set to ‘off’, the leading ‘.’ must be supplied by the user in the filename to be completed. This variable is ‘on’ by default.

As the variable is set to “on” by default, you should search for the line which sets it off and delete or comment it, e.g. in your ~/.bashrc:

grep match-hidden-files ~/.bashrc

If you can’t find where it’s set or want to set it explicitly, add the following line to $BASH_IT/lib/custom.bash (if you’re using Bash-it1) or ~/.bashrc (if not):

bind 'set match-hidden-files on'

1 Bash-it overwrites the ~/.bashrc when you update it, to keep the configuration you need to set the variable in any of Bash-it’s custom configuration files. Bash-it doesn’t set match-hidden-files off by default.


Here’s the exact opposite question: How to make bash stop tab autocompleting hidden directories

dessert
  • 40,956