Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij Idea's Completion Style for Bash

Is there any smarter bash completion than the normal one. I'm imagining having something like the auto completion feature of Intellij Idea. For example is there is a folder named anExampleFolder, if I type aEF or even aef and then press tab it completes it or somehow open a drop down menu.

like image 399
Mohammad Moghimi Avatar asked Nov 04 '22 00:11

Mohammad Moghimi


1 Answers

fzf ("fuzzy finder for your shell") may be what you're looking for. For your example of cd-ing to anExampleFolder, you have 3 options using fzf:

  • fdRETaEFRET
    • Launch fzf with recursive list of child directories. Enter fuzzy search term aEF, select match with arrow keys, accept.
  • ALTCaEFRET
    • Same as above but using a key binding instead of shell function
  • cd aEF**TABRETRET
    • Using the experimental auto-completion integration

Note that in all cases the arrow keys may not be necessary, if the fuzzy-search finds what you're looking for as the first match. And it can be used for lots of other stuff besides cd; the GitHub README has plenty of other examples and bindings.

like image 121
jbyler Avatar answered Nov 09 '22 13:11

jbyler