What are the benefits of recorded macros in the IDE?

As the name says, I see that many editors advertise macros as a function, but cannot find a way to use these functions on their own. So what can you use? The type in which you can record mouse movements and / or keystrokes? Is it really good for people? In particular, I am dealing with Eclipse, which has a number of built-in "fill" functions, so I really donโ€™t understand what the benefits may be.

+4
source share
6 answers

I use them all the time. Say, for example, I want to go to the list, indent by 4 and add "| *". In EMACS, I pressed Cx ( to start recording, make one sample line to see that this is what I want, ending with Cn Ca to go to the next line, and end the Cx ) macro Cx ) . Then Cx e repeats it line by line, and Cu number Cx e does this many times.

+3
source

Depends on what you do and what language you work with. As a simple example, right now I'm working with a Visual Basic.NET application that has several queries. I generally do all my work with queries in Toad, but Visual Basic.NET has an annoying syntax when it comes to long lines, namely:

 Public Const SelectData As String = _ "SELECT * " & _ "FROM myTable " & _ "WHERE myField = :SOMETHING" 

Since I really donโ€™t like editing queries when I copy them from code or paste them back, I have some macros that will automatically format or format them from them.

In addition, some macros can be used to automate common tasks that need to be performed while the development environment is running. Any sequence of commands that you often see is something you can turn into a macro and do it with just one click.

+1
source

Waaaay ago I used a macro to create a header / comment function. In addition, I did not use them.

Basically, you can โ€œautomateโ€ the tedious things you often do that do not have built-in methods for frequently performing tasks. This is a flexible way to give people a lot of energy so that they can work more efficiently.

0
source

I find this very useful in microsoft excel. Instead of looking for documentation to find each object and function, I need to call, I can record a macro that does most of what I want, take this code and change it to give me more subtle control.

0
source

In Visual Studio, I use macros for different purposes. One of the most valuable when debugging a Windows service. I can use the macro to start, and then connect to the Windows service, which is just a click away.

Also, sometimes I use custom DEFINES that need to be exploded into code - sort of like C / C ++ macros.

Colby africa

0
source

I also do not use them in Eclipse. That's why:

  • Eclipse has many powerful built-in functions and refactoring. So with the code, this is not necessary.

  • Eclipse macros are not that big. You can record them, but its hard to set up and do exactly what you want.

  • Macros are becoming more useful in things like modifying files that are not code. For this, I usually use something like vim. In addition, you should practice using macros to recognize when they help.

0
source

All Articles