Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dimaNovodes opened this issue Sep 16, 2024 · 0 comments

Comments

@dimaNovodes
Copy link

_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 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant