Hi
I often have to swap 2 words that are not adjacent to eachother
So I wrote a little python script and figured I'd share it
(There are 2 other threads that have similar but different functionalities. see one by Dev Player and another by kabiner)
This script works only with 2 selections
If the selection has a length, then the script uses those chars, otherwise, it will use the word under the cursor
After the script swaps the words, it sets a full selection on each of the 2 words swapped (just to show the actual swap)
There is an undo actions started at the beginning of the script, and ended at the end. This way, one control+z will undo the action (instead of 2)
Hi
I often have to swap 2 words that are not adjacent to eachother
So I wrote a little python script and figured I'd share it
(There are 2 other threads that have similar but different functionalities. see one by Dev Player and another by kabiner)
This script works only with 2 selections
If the selection has a length, then the script uses those chars, otherwise, it will use the word under the cursor
After the script swaps the words, it sets a full selection on each of the 2 words swapped (just to show the actual swap)
There is an undo actions started at the beginning of the script, and ended at the end. This way, one control+z will undo the action (instead of 2)
Hope others can find this helpful as well
Davey