Pwdr
Pwdr

Reputation: 3781

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.

Upvotes: 4

Views: 7748

Answers (1)

cody
cody

Reputation: 3277

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

Upvotes: 9

Related Questions