Last Updated: July 8, 2019

Character Transpose

Macro Monday – a new macro to dig into every Monday!

Swap character order using the transpose macro. Easily augmented to swap whole
words as well when word is selected.

Character Swapping with Transpose

An obscure but often useful (when you get used to it) tool I’ve encountered in a few places is the Transpose tool.
In its most basic form, it swaps the positions of the character at the current caret position and the next character in the line.

You can easily add more functionality by detecting a selection using ~~~ko.view.manager.currentView.scimoz.selectionEmpty~~~
and transposing whole words instead of characters.


To install the macro simply hit the “View Resource” button below, for instructions
on how to install it refer to the Install Resources Documentation.


To use the macro, make an editor selection and then invoke the macro – by
double-clicking on the macro in the toolbox, using the Invoke Tool
(Ctrl+Shift+K) to search/execute “img tag dimensions”, or assigning your own
keybinding to the macro. Click on the link below and have a look at the source
for yourself.

Carey Hoffman

Carey Hoffman

Carey made the logical switch from snowboard instructing and treeplanting to the technology industry in 2009, taking database and network administration at Vancouver BC's BCIT college. Having started out on the technical support and QA team for ActiveState he now works on the Komodo development team as a front and backend software engineer.