这是indexloc提供的服务,不要输入任何密码
Skip to content

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

@dimaNovodes

Description

@dimaNovodes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions