Home » Questions » Computers [ Ask a new question ]

Mac OSX terminal bash-completion not working

Mac OSX terminal bash-completion not working

I just followed the instructions @ this question in order to get git autocompletion in the terminal. Here are the steps I've undertaken:

Asked by: Guest | Views: 223
Total answers/comments: 1
Guest [Entry]

"I think the easiest way is to switch to zsh. There is some configuration that has to be done, but that's about it.

I added this to my ~/.zshenv file

#******************************************************************************************
# From http://zshwikidotorg/home/examples/compquickstart
zmodload zsh/complist
autoload -U compinit && compinit

_force_rehash() {
(( CURRENT == 1 )) && rehash
return 1 # Because we didn't really complete anything
}
zstyle ':completion:::::' completer _force_rehash _complete _approximate
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
zstyle ':completion:*:descriptions' format ""- %d -""
zstyle ':completion:*:corrections' format ""- %d - (errors %e})""
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose yes"