macros

Ahh, finally, macros :)

Now that I have gotten used to IntelliJ without them, I have to scratch some
dead gray brain cells to remember what I used to do with them (I remember
vaguely that they were very useful).

The first thing that came to my mind was to create a macro to reformat the
code and then optimize imports...

One problem I encountered was that the macro engine doesn't seem to have
automatic pressing of buttons in dialogs, so I have to press Enter twice
during this very simple macro.

Does anyone have any useful macros to share?

Thanks,
Amnon I. Govrin


6 comments
Comment actions Permalink

Does anyone have any useful macros to share?


I haven't created it yet, but one might be useful is combining line comment
and line duplication
You have the code :

...
myObject.doSomething("blah-blah"); |
..

Then launch your macro, and you'd have

...
// myObject.doSomething("blah-blah");
myObject.doSomething("blah-blah"); |
...

Sometimes, I just want to test something, but I want to keep the original
line.
For me, at least, it's useful :)

Guillaume



0
Comment actions Permalink

Yes, I agree. That is quite useful.

"Guillaume Laforge" <glaforge@reflexe.fr> wrote in message
news:bfm5jr$696$1@is.intellij.net...

Does anyone have any useful macros to share?

>

I haven't created it yet, but one might be useful is combining line

comment

and line duplication
You have the code :

>

...
myObject.doSomething("blah-blah"); |
..

>

Then launch your macro, and you'd have

>

...
// myObject.doSomething("blah-blah");
myObject.doSomething("blah-blah"); |
...

>

Sometimes, I just want to test something, but I want to keep the original
line.
For me, at least, it's useful :)

>

Guillaume

>
>


0
Comment actions Permalink

Hmm, nice
"Guillaume Laforge" <glaforge@reflexe.fr> wrote in message
news:bfm5jr$696$1@is.intellij.net...

Does anyone have any useful macros to share?

>

I haven't created it yet, but one might be useful is combining line

comment

and line duplication
You have the code :

>

...
myObject.doSomething("blah-blah"); |
..

>

Then launch your macro, and you'd have

>

...
// myObject.doSomething("blah-blah");
myObject.doSomething("blah-blah"); |
...

>

Sometimes, I just want to test something, but I want to keep the original
line.
For me, at least, it's useful :)

>

Guillaume

>
>


0
Comment actions Permalink

I can't seem to find a way to assign a key mapping to start/stop recording a
macro. Also I'd like to be able to find a way to have a keystroke to play
back the last (temporary/unnamed) macro. Anyone found out how to do this? I
think maybe I'm just blind! :)

"Amnon I. Govrin" <agovrin@freshwater.com> wrote in message
news:bfm595$57i$1@is.intellij.net...

Ahh, finally, macros :)

>

Now that I have gotten used to IntelliJ without them, I have to scratch

some

dead gray brain cells to remember what I used to do with them (I remember
vaguely that they were very useful).

>

The first thing that came to my mind was to create a macro to reformat the
code and then optimize imports...

>

One problem I encountered was that the macro engine doesn't seem to have
automatic pressing of buttons in dialogs, so I have to press Enter twice
during this very simple macro.

>

Does anyone have any useful macros to share?

>

Thanks,
Amnon I. Govrin

>
>


0
Comment actions Permalink

Fixed in 874

--

Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"Chris Miller" <chris_overseas@hotmail.c0m> wrote in message
news:bfonml$dd$1@is.intellij.net...

I can't seem to find a way to assign a key mapping to start/stop recording

a

macro. Also I'd like to be able to find a way to have a keystroke to play
back the last (temporary/unnamed) macro. Anyone found out how to do this?

I

think maybe I'm just blind! :)

>

"Amnon I. Govrin" <agovrin@freshwater.com> wrote in message
news:bfm595$57i$1@is.intellij.net...

Ahh, finally, macros :)

>

Now that I have gotten used to IntelliJ without them, I have to scratch

some

dead gray brain cells to remember what I used to do with them (I

remember

vaguely that they were very useful).

>

The first thing that came to my mind was to create a macro to reformat

the

code and then optimize imports...

>

One problem I encountered was that the macro engine doesn't seem to have
automatic pressing of buttons in dialogs, so I have to press Enter twice
during this very simple macro.

>

Does anyone have any useful macros to share?

>

Thanks,
Amnon I. Govrin

>
>

>
>


0
Comment actions Permalink

Yes, you should be able to do everything in a macro including pressing
buttons in dialogs. A macro should require no interactive user input during
execution.

"Amnon I. Govrin" <agovrin@freshwater.com> wrote in message
news:bfm595$57i$1@is.intellij.net...

Ahh, finally, macros :)

>

Now that I have gotten used to IntelliJ without them, I have to scratch

some

dead gray brain cells to remember what I used to do with them (I remember
vaguely that they were very useful).

>

The first thing that came to my mind was to create a macro to reformat the
code and then optimize imports...

>

One problem I encountered was that the macro engine doesn't seem to have
automatic pressing of buttons in dialogs, so I have to press Enter twice
during this very simple macro.

>

Does anyone have any useful macros to share?

>

Thanks,
Amnon I. Govrin

>
>


0

Please sign in to leave a comment.