Key Binding to Swap Words
In the Web Excursions from February 28th, Brett referred to the NSStandardKeyBindingResponding documentation.
This gave me the idea to create a key binding that can swap two words.
For example, if I have the following text. I set a cursor between ipsum and dolor, hit Option-Shift-t and It swaps the words.
Lorem ipsum dolor sit amet
Lorem dolor ipsum sit amet
Here’s my key binding:
"~$t" = (moveWordLeft:, moveWordRightAndModifySelection:, cut:,
deleteBackward:, moveWordRight:, moveRight:,
paste:, insertText:, " ", moveWordLeft:);
Feel free to share additional ideas.