Hi everybody,
autohotkey is a software that is very powerful. You can do small hotkeys and very large operations with almost unlimited steps
So I wrote a little script that does
duplicate a line of code and add add "//" to the upper line to deactivate it through commenting
example
this line shall be copied and upper line commented
press shift-Ctrl-D to duplicate
result
//this line shall be copied and upper line commented
this line shall be copied and upper line commented
I find this very useful for quick testings of variants of a line of code
You can assign (almost) any key to execute these operation.
The operation is done through sending a sequence of key-strokes just as you would press the keys yourself
So here is the Autohotkey-script for doing this
+^d:: ;duplicate line and make upperline a comment
Send {End}
Send {Home}
Send {Home}
Send +{Down}
Send ^c
Send {Up}
Send {End}
Send {Home}
Send //
Send {Down}
Send {End}
Send {Home}
Send {Home}
Send ^v
return
"+^d" means assign this script to key Shift-Ctrl-d
- is the shift ^ is the control-key
it works regardless of were the cursor is in the line.
A well chosen sequence of home end-keystrokes does position the cursor to the right place
best regards Stefan