The plugin transwrd.vim allows to to easily swap two words by pressing <A-t>
while having cursor on the latter word.
For example: two words
becomes words two
.
I think the pattern which designates a word is contained in the g:transwrd_wordpattern
variable and is (as default) the following: \k\+
Is it possible to define an advanced pattern which allows to be more programming language savvy (while still working for normal words)? Eg.
param[0], param[1] --> param[1], param[0]
int call1() --> call1() int
This way it could also be used to swap function arguments (related to this other question).