Actually, I'm running Bash, and I'll like to make a settle modification at the configuration. With zsh and fish, we have the opportunity to display files and directories when we press Tab. Is there a mofication to .bashrc we could make to do similar thing?

enter image description here

Thanks in advance!

  • When you say display, you mean print the file and directory names in the current directory, correct? Not literally print their contents?
    – Seth
    Jan 11 '17 at 1:55
  • @Seth In fact, with fish, when I press tab I obtain the picture I added in my question. If I press another time on tab, I could choose the Desktop, another time Downloads, and so on.
    – user639897
    Jan 11 '17 at 2:01
bind 'set show-all-if-ambiguous on'
bind 'TAB:menu-complete'

will get you close. The only difference is it automatically appends the first result to your command, which is pretty annoying if the directory is fairly full (and there aren't any pretty colors).

source: Bash autocomplete like zsh

  • I install what you recommended, but It is still not working. I opened .bashrc such as I could copy-paste your two recommended lines. Once I did that, I reboot the system, and opened a new terminal window. When I pressed on tab, nothing happened. Is it normal?
    – user639897
    Jan 11 '17 at 2:25
  • @DavidHilbert hm, it might not work at an empty prompt. Try it with cd.
    – Seth
    Jan 11 '17 at 2:45
  • Yes, it works. (If you want) Do you have an idea how to select the file or directory, like fish, with a little bit of color?
    – user639897
    Jan 11 '17 at 2:47
  • @DavidHilbert I don't. Sorry.
    – Seth
    Jan 11 '17 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy