fabioz / mu-repo

Tool to help in dealing with multiple git repositories
http://fabioz.github.io/mu-repo/
Other
295 stars 37 forks source link

can someone please tell how can I enable autocomplete for git commands? #79

Open dimaNovodes opened 1 month ago

dimaNovodes commented 1 month ago

_mu_autocomplete() { local cur prev words cword _get_comp_words_by_ref -n : cur prev words cword

# Check if the command starts with 'mu'
if [[ "${words[0]}" == "mu" ]]; then
    # Remove 'mu' from the words and forward to Git's autocompletion
    COMP_WORDS=("${COMP_WORDS[@]:1}")
    COMP_CWORD=$((COMP_CWORD - 1))

    # Simulate git command after removing 'mu'
    _git
    return 0
fi

}

Enable autocompletion for 'mu' command

complete -F _mu_autocomplete mu

doesnt work for me :(