Making zsh autocorrect work with custom git aliases

Viewed 1330

I have a custom alias for git that I use with git df (it’s basically a shortcut for git diff).

However, with git’s zsh autocorrect, everytime I use git df in a directory that contains a db directory, I get this:

% ls
app/ config/ db/ lib/ log/ spec/

% git alias | grep "df"
df = diff

% git df
zsh: correct 'df' to 'db' [nyae]?

Is there a way I could make zsh aware of my git aliases so it takes them into account when trying to autocorrect my commands? I want it to detect that git df exist and not suggest me git db instead.

I don’t want to create a zsh alias (eg. alias gdf="git diff") or use alias git="nocorrect git".

Thanks for your help!

3 Answers
Related