zsh autocorrect, edit option. Possible to bring cursor to the wrong command?

484 Views Asked by At

This is only a tiny, tiny gripe I just experienced right now.

zsh will try to autocorrect car someTextFile.txt. Unfortunately zsh suggests xar someTextFile.txt when I really want cat.

When I choose the edit option (eat the [nyae] prompt), zsh presents me with this: car someTextFile.txt| (the |is the cursor position). What I would really like is for zsh to place the cursor at the misspelled command. Like this: car| someTextFile.txt – is that possible?

Just a small annoyance :-)

1

There are 1 best solutions below

0
On

I don't know how to accomplish what you desire. However, for commands that you commonly mistype you can add an alias to your .zshrc:

alias car='cat'

That way, when you mistype, 'car' will be run 'cat'.