As promised, today's tip is about macros. What are they? These are actions which are recorded according to what you do in the editor. Depending how good you are, you can create even such action such as surround with try-catch, comment a piece of code, etc.

You can record the macros by pressing the red button in editor toolbar, perform the actions and then end recording by pressing the grey square next to the button. Then you name the macro and assign a shorcut to it. To execute the macro, you just need to press the shortcut you've assigned.

Here are the available macros:

  • Ctrl-J I- Surround with if()
  • Ctrl-J T- Surround with try-catch
  • Ctrl-J L- Add debug code
  • Ctrl-N P- Create property
  • Ctrl-J {- Add a block
  • Ctrl-J H- Comment code
  • Ctrl-N F- Define identifier by previous class
  • Ctrl-N S- Delete two words
  • Ctrl-J C- Trim
  • Alt-U Q- Toggle case of identifier
  • Ctrl-J [- Format code
  • Ctrl-J D- Debug variable
  • Ctrl-J F - Add editor fold

Most of these macros require to have selected a piece of code in the clipboard. You may not use all of these, but they're a good source of inspiration for creating your own macros. Actually this way you can add simple features to your IDE. How cool is that? :-)

Source: Roumen's Weblog