How do I tell zsh to correct simple spelling mistakes automatically?
For example:
I want lsbkl to automatically be corrected to lsblk, after hitting Enter, without showing zsh: correct 'lsbkl' to 'lsblk' [nyae]?.
Is this possible to achieve?
How do I tell zsh to correct simple spelling mistakes automatically?
For example:
I want lsbkl to automatically be corrected to lsblk, after hitting Enter, without showing zsh: correct 'lsbkl' to 'lsblk' [nyae]?.
Is this possible to achieve?
This will autocorrect the word to the left of the cursor whenever you press Space or Enter:
autocorrect() {
zle .spell-word
zle .$WIDGET
}
zle -N accept-line autocorrect
zle -N magic-space autocorrect
bindkey ' ' magic-space