Jump to content

Recommended Posts

Posted

If you use notepad+ as an editor for Autolisp, the CTRL+ALT+b leaves a lot to be desired when it comes to selecting between brackets.

 

The VLIDE double-click is much more satisfying.

 

So here is an AutoHotKey script that gives you  this functionnality while preserving the normal Dbl-Click of notepad+:

 

#Requires AutoHotkey v2.0
#SingleInstance Off 

; 1. Set up a unique communication highway (MsgNumber 0x401)
OnMessage(0x401, ReceiveCloseSignal)
ReceiveCloseSignal(wParam, lParam, msg, hwnd) {
    ExitApp
}

; 2. Find any running old instance (ignoring itself) and send it the "Self-Destruct" signal
DetectHiddenWindows True
if (oldScriptHwnd := WinExist(A_ScriptFullPath " ahk_class AutoHotkey")) {
    if (oldScriptHwnd != A_ScriptHwnd) { ; Ensure the script doesn't close itself!
        PostMessage(0x401, 0, 0, , "ahk_id " oldScriptHwnd)
        WinWaitClose("ahk_id " oldScriptHwnd, , 2)
    }
}

; 3. Automatically relaunch the script using UI Access to bypass UAC entirely
if !A_IsCompiled && !InStr(A_AhkPath, "_UIA.exe") {
    uiaPath := RegExReplace(A_AhkPath, "\.exe$", "_UIA.exe")
    if FileExist(uiaPath) {
        try {
            Run('"' uiaPath '" "' A_ScriptFullPath '"')
            ExitApp
        }
    }
}

; 4. Your Application-Specific Hotkeys
#HotIf WinActive("ahk_class Notepad++")

~LButton:: {
    static lastClick := 0
    currentClick := A_TickCount
    
    if (currentClick - lastClick < DllCall("GetDoubleClickTime")) {
        KeyWait("LButton")
        Sleep(60) 
        SendEvent("^!b")
        lastClick := 0
    } else {
        lastClick := currentClick
    }
}
#HotIf

 

Link to download AutoHotKey https://www.autohotkey.com  also available on Microsoft app store (Free)

NppBrackets.ahk

  • Like 1
Posted

I use this in visual studio to toggle between header and source. also since I'm a southpaw, I use home and end for copy paste

autohotkey is the GOAT!

 

#z::Run www.autohotkey.com

;ALT + XX
;
home::send ^c ;
end::send ^v ;
#IfWinActive ahk_exe devenv.exe
;PgUp::SendRaw `,DS.ARGS() ;misc command
;PgDn::SendRaw `,DS.ARGS({"val:type"}) ;misc command
Insert::send ^k^o ;toggle header/source
Delete::send ^a^k^f{Esc} ;select all and format
#IfWinActive

 

  • Like 2
  • Funny 1
Posted

Never thought about that - I always still use ctrl+ V / C - means I have to let go of the mouse every now and then

  • Like 1
Posted

FYI: When running VS Code to select everything including the parenthesis,

When near the beginning of the code:

Click position right in front of the open parenthesis, then hit the following keyboard combinations Shift+Ctrl+Alt then Down Arrow

When near the end of the code:

Click position right after the close parenthesis, then hit the following keyboard combinations Shift+Ctrl+Alt then Up Arrow

Posted (edited)

Hi Paul,

 

When a keyboard shortcut requires 4 keys, I'm not so sure we should consider it a shortcut anymore.

 

Thanks, for the info nonetheless.

 

ymg

Edited by ymg3
typo
Posted (edited)

I use Notepad++ so had a look, interesting when you click the little - button on the left it shrinks text paragraphs, you can select all that is shrunk using CTRL C then Ctrl V but you need a dummy next line for it to work. 

 

image.png.3a59afcb805e276a56f920fa53d1a81f.png

 

Used AI found answer no dummy line needed.

Pick to right of + sign use "Begin/end select"

 

(defun col1 ( / l)
(setq x 1)
(repeat (length ah:butlst)
    (setq l (strcat "1Rb" (rtos x 2 0)))
    (if  (= (get_tile l) "1" )
        (setq ah:col1 x)
    )
    (setq x (+ x 1))
)
(princ)
)

 

Edited by BIGAL
Posted
8 hours ago, BIGAL said:

I use Notepad++ so had a look, interesting when you click the little - button on the left it shrinks text paragraphs, you can select all that is shrunk using CTRL C then Ctrl V but you need a dummy next line for it to work. 

 

image.png.3a59afcb805e276a56f920fa53d1a81f.png

 

Used AI found answer no dummy line needed.

Pick to right of + sign use "Begin/end select"

 

(defun col1 ( / l)
(setq x 1)
(repeat (length ah:butlst)
    (setq l (strcat "1Rb" (rtos x 2 0)))
    (if  (= (get_tile l) "1" )
        (setq ah:col1 x)
    )
    (setq x (+ x 1))
)
(princ)
)

 

 

Pick to right of + sign use "Begin/end select" is what I do, though I don't use Notepad++ very much.

 

The CTRL+ALT+b is pretty easy for me if I am using a right-hand mouse, like Daniel I would have to figure out a good shortcut if using a mouse left-handed.

 

I used to use a lot of custom shortcuts/ inputs, but at one point I was working on various computers doing things and would have a "brain freeze" trying to figure out how it was normally done on some things so got out of the habit.

 

Now I don't really do much that's not on one of my computers or work computer, though occasionally I get an email or call on how to do something, so probably a good time to go back to using shortcuts.

 

Not sure what everybody else has, but my MS VS Code, I just select just inside a bracket and double-click to select all between the related brackets.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...