Let Comment Flags Keep Aligned
-
When I press ctrl+q to comments the code lines, the comments flag “rem” not to be placed at the front of the line. Can you make it keeping aligned.
Just as follow:
-
Here’s what I do for this. Add this to the
<Macros>
section of yourshortcuts.xml
file:<Macro name="Col. 1 Remark" Ctrl="yes" Alt="yes" Shift="no" Key="75"> <Action type="0" message="2349" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="REM " /> </Macro>
Key
75
is the letter K, so this adds a Ctrl-Alt-K keystroke to your configuration (you said Ctrl-Q, but my solution isn’t a toggle like that keystroke; if you want Ctrl-Alt-Q, change75
to81
); message2349
says to go to the beginning of the line (unconditionally, i.e. not just the beginning of the text on the line); and message2170
says to type the given text -REM
and a space (the forum won’t let me show the space in red here). If you edit other types of files this way, you can change to the comment string for whatever language you’re using, and assign a different key for that one.