Mac – Easy way to swap characters in command line with emacs key bindings

bashcommand lineemacskeyboard shortcuts

If I'm in vi, and I see that I've transposed two characters, it is easily fixed by putting the cursor over the first and typing x followed by p in command mode.

Is there a similar trick that works at the bash command line in emacs mode? I realize that I can set to vi key bindings, but I prefer not to do that given that emacs key bindings are the default for many command lines in my life.

Best Answer

Emacs key binding Ctrl-t runs the command transpose-chars, which also works in the terminal

Related Question