Swap the Last Two Characters Typed on Mac with a Keyboard Shortcut
How many times have you typed something to discover the last two characters are in the wrong order?
You know, when “the” turns into “teh” and “something into “somethign”, a fairly common general mistype.
Well the Mac has a solution to this, with a great little keystroke that swaps the last two characters.
Apparently “the” turns to “teh” often enough, and other similar typos happen often enough for there to be an individual keyboard shortcut to instantly swap the last two typed characters, and that keyboard shortcut is Control+T.
Open just about any app in Mac OS X and try it yourself, get the hang of it and it’s certainly faster than hitting delete twice and retyping the two characters again.
This is an old keyboard shortcut from the unix world of text editors that has carried over into Mac OS X. That suggests this little trick should work the same with Linux and other unix based operating systems too.
The keyboard shortcut is most useful if you have autocorrect disabled, otherwise those minor typos tend to fix themselves.
Great tip from @maguay thanks, don’t forget to send in your great Mac tips too!
I thought this was a very useful tip. Why get so bent Bob & Hish? Just gotta let those rocks keep falling out of your head, huh.
Everyone should know this already! Are we going to post an article for every single Emacs key binding? Post them all in one article and be done with it.
I think the problem is that Mac user are for the most part like Kelly Bundy—every time a new fact goes in their brain and old one falls out. Hell iOS is based on the fact that Mac user are to stupid to remember where they put a stylus.
Attention everyone: Bob knows everything. Time to shut down the internet since Bob is a genius!
Another great example of over shortcutting even the simplest of things.
Why don’t we yet have (Cmd + control + S) to add a space after a word?
Because that would be stupid!
Ctrl+T cuts keystrokes for a common mistake in half. If you don’t use this the solution you must type: del, del, key, key. Very useful in Terminal.app where autocorrect is not supported.
It’s optional. You don’t have to use it, and ctrl-t isn’t being used for anything else. Over-short-cutting would be assigning cmd-ctrl-shift-H to Help.
This is just a standard Emacs command. Most Emacs commands work when entering text in most programs. This goes for OS X, Linux and Windows. And, since I am a Vim user this makes me sad :(
Would you have preferred ESC x left-arrow p?
Anyway, you can set vi-style editing in bash (i.e., the Terminal): $ set -o vi
Just put it in your .bash_profile.
Yes I have it set in bash. I have heard of this thing called AltaVista that let’s you search the interweb for information.
I want it for every program in OS X. I guess I don’t care anymore as OS X is clearly targeting moronic iOS users, and I will be jumping ship soon.
I’m glad you’ve heard of AltaVista. You might also be interested to check out some of those newcomers, like geocities.
Anyway, you can’t have vi keybindings in every program in OSX the way you can have (some!) emacs keybindings. And if you’re so clever, you surely know why: it would mean a modal interface, the one we all hate. I certainly don’t want to hit ESC every time I want to go to the start of the line.
So you’re … o wait, you’re trolling. Sorry, now I see.
Damn! Was it the AltaVista ref that gave be away? LOL
However, I am jumping ship, as OS X is not going in a good direction.