Character Transpose

komodo ide blog hero

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.

Recent Posts

Scroll to Top