Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I do a find (not a find all, which closes the dialog) or replace in Notepad++, the focus will remain on the find/replace dialog. If I want to focus on the main window with the text in it, I either have to click or clumsily alt-tab + alt-shift-tab, or to close it I have to click. Is there a keyboard shortcut for closing the find/replace dialog?

I have read this question, but it relates to the opposite situation - his version of Notepad++ was focusing on the main window after a find or replace and he was wanting to revert focus back to the dialog.

I'm on 64-bit Win7 if that makes any difference.

share|improve this question
    
If you had read Nate's comment carefully, it was clear that the loss of focus issue was with an older version of Notepad++. On newer versions the dialog remains focused and Esc closes it, which he mentioned as well. –  Karan Mar 13 '13 at 1:25
    
@Karan - whoops –  John Straka Mar 13 '13 at 12:45

3 Answers 3

up vote 4 down vote accepted

Esc will close the find/replace dialog and return focus to the main window.

share|improve this answer
    
Thanks! I appreciate it. –  John Straka Mar 12 '13 at 20:36
    
This does not work in the most recent versions. –  Ed Cottrell Jan 12 at 3:25
    
@EdCottrell: I just tried the two most recent versions, v6.5.2 and v6.5.3. This method still works in both. –  Marcks Thomas Jan 12 at 11:47
    
Actually, I now see I misread the question; I thought OP was asking how to close the Find Results window, not the Find/Replace dialog. You are correct that Esc will close the latter. –  Ed Cottrell Jan 12 at 16:35

Edit: I misread this question originally and thought it was asking how to close the Find Results window. The bulk of my answer below addresses the Find Results window. For the Find/Replace dialog, Marcks Thomas posted the correct answer - Esc will do the trick.


There is no keyboard shortcut to close the Find Results window. It is possible to create a hotkey, however, using AutoHotKey. The following script will convert F7 from an open-only shortcut to a toggle; it opens it if it isn't already open, and closes it if it is.

Here is the script:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Ed Cottrell's AutoHotKey script for toggling the "Find Results" pane/window in Notepad++
; Released under the MIT License (http://opensource.org/licenses/MIT)
; Version: 1.1
; Release Date: January 15, 2014
; Released on Superuser.com: http://superuser.com/questions/700357/create-a-hotkey-keyboard-shortcut-to-close-the-notepad-find-results-window
; Also released at www.edcottrell.com/2014/01/11/toggle-find-results-window-notepad-hotkey/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Turn F7 into a toggle for the Notepad++ search results window; currently it shows it, but doesn't hide it.
; The $ prevents this from firing itself
*$F7::
Open := 0
SetTitleMatchMode 2  ; AHK doesn't seem to recognize the window title otherwise
; See if Notepad++ is the active window or if the undocked results window (ahk_class #32770) is the active window
If WinActive("Notepad++")
{
    ; If the results pane is open, close it
    ; Button1 is the class name for the title bar and close button of the results pane when docked
    ControlGet, OutputVar, Visible,, Button1, Notepad++
    if ErrorLevel = 0
    {
        If OutputVar > 0
        {
            ; Found it docked
            Open := 1
            ; Get the size and coordinates of the title bar and button
            ControlGetPos, X, Y, Width, Height, Button1
            ; Set the coordinates of the close button
            X := Width - 9
            Y := 5
            ; Send a click
            ControlClick, Button1,,,,, NA x%X% y%Y%
        }
    }
}
; If it is undocked, use ahk_class #32770
else If WinExist("Find result ahk_class #32770")
{
    ; Found it undocked
    Open := 1
    ; Close it
    WinClose
}
; It's not open, so open it
if Open = 0
{
    SendInput {F7}
}
return

I hope this helps everyone else out there who loves Notepad++!

Edited to fix error in detection of undocked window.

share|improve this answer

There is an open issue accepted for next release.

http://sourceforge.net/p/notepad-plus/feature-requests/2400/

Just wait a few! -I see your question is 3 months ago-

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.