# No arguments: `git status` # With arguments: acts like `git` function g() { if [[ $# > 0 ]]; then git $@ else git st fi } # Complete g like git compdef g=git
# Complete g like git compdef g=git
It's actually a oh-my-zsh plugin, called "magic-enter".
I defined MAGIC_ENTER_GIT_COMMAND="git status" and then included the plugin.
You can find a different but similar plugin here: https://github.com/zshzoo/magic-enter/blob/main/magic-enter....