(NOT a possible duplicate. Exchange text around an equal sign :)
Very often I find that I exchange things. This is a pain in the ass.
Say right after I write this piece of code
tmp = realloc (words, sizeof (char **) * (*count + 1));
I noticed that there are too many stars in the line, I donβt like it, and you want to change two factors around the multiplication asterisk.
Or I write
#if !defined(_CONSOLE_H_) && defined (__MINGW32__)
but I suddenly realize that defined (__MINGW32__) should be the first for some reason.
I think it would be great if I could do something like this:
(The cursor position is indicated on x , [x] . <S> stands for this hypothetical swap around command)
#if [!]defined(_CONSOLE_H_) && defined (__MINGW32__)
command: vf&<S>$ => select from the cursor to the pivot point (word && ) and change the selection around the text to the end of the line.
Or, for the previous example:
tmp = realloc (words, [s]izeof (char **) * (*count + 1));
: v3f*<S>f) => select from here to the third * , replace the text with ) text forward.
It would be incredibly useful to me. Is there something like this, or should I write my own plugin?
Thanks!
EDIT -
Like @ib. says in the comments on his answer, I need to be more specific as to what is the core.
The summary can also be a symbol, for example here:
static char ** tokenize_input (char * input, PDWORD count);
I can swap two arguments around "," . More precisely, ", " .
So maybe I need two commands:
<s> - char-wise - the pivot is the last character of the selection; <S> - word-wise - the pivot is the last word of the selection.
Thanks! (ps. how about the last word ? :)