Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-Completion in Mac OS X Terminal – custom word list

I would like to auto-complete the arguments in my function foo. I want to store a list of possible arguments like this: bar,baba,gugu.

So when I type foo b[TAB]in Terminal, I would like to have the recommendations of bar and baba.

like image 390
Pwdr Avatar asked Jan 11 '23 07:01

Pwdr


1 Answers

Here you go: http://freecode.com/projects/bashcompletion

You can install it via brew: brew install bash-completion. During installation brew will say what to do next - add some lines to your ~/.bash_profile:

if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
fi

Take a look at README for instructions on how to add custom completions

like image 77
cody Avatar answered Jan 17 '23 11:01

cody