Search code examples
sasenterprise-guide

Shortcut to comment selected code in SAS Guide


is there some shortcut to just comment the selected code in SAS Enterprise Guide?

There is Ctrl + / to comment the selected line. But would be really useful to comment just a selected part of the code.

Thanks.


Solution

  • You can create a Keyboard Macro for this (Program > Editor Macros > Macro...), as shown below. Only limitation is that the selection must be made from left to right / top to bottom. A workaround would be to use instead Cut selection, inserting /*, Paste from clipboard and inserting */. Drawback this time is that you'd lose previous clipboard content.

    Edit Keyboard Macro - Comment Selected

    Then, just assign it a keyboard shortcut, like CTRL-SHIFT-C for instance.

    [EDIT]

    While we're at it, here's another one to uncomment the blocks enclosed by /* and */:

    Edit Keyboard Macro - Uncomment block

    For this one, I assigned the keyboard shortcut CTRL-SHIFT-D.