Here's how you can select the integer $ php_variable / $ word in Npp, including the $$ sign, with Alt + Click:
EDIT: Now I understand that you can skip the Npp macro and only do this with AutoHotKey. But I still leave the macro if someone likes it. For more information, see AutoHotkey.chm, on the content tab, go to: Kheyboard Control → Send / SendRaw ...
Do not put spaces between {LButton} {...} or they will be inserted into the editor (the space after the comma looks normal).
It will probably look like something similar (havent checked it out).
!LButton:: Send, {LButton}{CTRLDOWN}{LEFT}{CTRLUP}{LEFT}{CTRLDOWN}{SHIFTDOWN}{RIGHT}{RIGHT}{SHIFTUP}{CTRLUP} return
End edit
I finally did it with
- Autohotkey (google it).
- npp macro
Macro:
- before you start recording a macro: click inside the php variable so that it contains a blinking cursor (for example:
$php_varia|ble ) - now gets into the recording macro
- now press: Ctrl + left, left (without Ctrl), ctrl + shift + right, ctrl + shift + right; This will select the entire php variable / word, including '$'
- stop the macro recording, then: "Save the current recorded macro." Assign it a keyboard shortcut (I assigned Ctrl + Alt + Shift + B)
Autohotkey script:
; alt + click translated to Click followed by Ctrl Shift Alt B !LButton:: Send, {LButton}{CTRLDOWN}{SHIFTDOWN}{ALTDOWN}b{ALTUP}{SHIFTUP}{CTRLUP} return
Now that you have Alt + click on the php variable in NPP, select all of it, including the $ sign.
I also have a script to copy / cut / paste with Ctrl + LMouseBtn / Ctrl + Shift + LMouseButton / Ctrl + RMouseButton:
^RButton:: Send, {CTRLDOWN}v{CTRLUP} return ^LButton:: Send, {CTRLDOWN}c{CTRLUP} return ^+LButton:: Send, {CTRLDOWN}x{CTRLUP} return ; the plus sign means the Shift key, etc ; see 'Keyboard control' >> 'Hotkeys and Hotstrings' in the Autohotkey help.chm
snrp
source share