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.

How can I switch to the document to the left or right of the current document in Notepad++? For example, if I have documents A, B, and C open, and I'm currently editing B, I would like a shortcut to be able to switch to A (Alt-LeftArrow or Ctrl-Pageup) or C (Alt-RightArrow or Ctrl-PageDown). Is this possible? All I've found is a way to switch to next or previous documents based on the "history" of when the document was last opened (Ctrl-Tab and Ctrl-Shift-Tab), which are useful, but not what I want.

share|improve this question
4  
I can't believe this only had one upvote. ++. –  ripper234 Oct 19 '10 at 10:44
add comment

migrated from stackoverflow.com May 3 '10 at 17:25

This question came from our site for professional and enthusiast programmers.

3 Answers

Settings -> Preferences -> MISC, Document switcher (Ctrl-TAB). Uncheck the "Enable" checkbox. Documents will then be navigated to in the order they appear in the tabs.

You can also assign different keyboard shortcuts to next/previous document if you prefer.

share|improve this answer
1  
Disabling the Most Recent Use (MRU) behavior under settings should do what you want. –  Greg Bray May 4 '10 at 2:12
add comment

Natively

You can do this natively in Notepad++, but in order to replicate the behaviour of Firefox, you need to disable the document switcher and MRU behaviour.

Disable MRU functionality

  1. Navigate to Settings > Preferences... > MISC..
    • Where it says Document Switcher (Ctrl+TAB) uncheck the first check box Enable.
    • Hit the Close button.

Create the Ctrl+PGUP/PGDN shortcuts

  1. Navigate to Settings > Shortcut Mapper....
    • Make sure you are on the Main menu tab.
    • Scroll to the bottom and you should see in entries 192 Switch to previous document and 193 Switch to next document.
    • By default these should be mapped to Ctrl+Shift+Tab and Ctrl+Tab respectively.
    • Double click anywhere on the 192 line and change it to Ctrl+Page up.
    • Double click anywhere on the 193 line and change it to Ctrl+Page down.
    • Hit the Close button.

That's it!

Please note that you will no longer have access to the Ctrl+Tab/Shift+Tab MRU behaviour now. If, like me, you cannot live without this read on.

Another (better) option

Notepad++ defaults to using the back and forward buttons on a mouse to switch to the adjacent left and right tabs, so if you are a fan of AutoHotkey, you can use this little script:

#IfWinActive, ahk_class Notepad++
; Switch to the adjacent tab to the left
^PgUp::
    Send, {XButton1}
    Return
; Switch to the adjacent tab to the right
^PgDn::
    Send, {XButton2}
    Return

This won't interfere with other programs and enables to you have your cake and eat it! You can navigate left and right through adjacent the tabs using Ctrl+PgUp and Ctrl+PgDn and you can still switch to your last used tab using the built-in document switcher functionality using Ctrl+Tab and Ctrl+Shift+Tab - just like Firefox :)

share|improve this answer
    
This is just what I've been wanting for a long time.. to be able to use Ctrl+PgDown AND/OR Ctrl+Tab to move to the next Tab (and the complementary inverse)... I haven't tried it yet, but I will tomorrow... I'll be using Autoit3 (the parent of AutoHotKey, as I understand.. AutoHotKey forked off from Autoit me-thinks, if my memory is up to par :) –  Peter.O Aug 6 '10 at 10:17
    
Wow, where's the +100 button? –  David Harkness Feb 21 '12 at 3:41
    
Unfortunately, if holding ctrl and pressing pgup multiple times, the subsequent presses have no effect. This is different from what I'm used to in other apps, eg Firefox. –  Mads Skjern Nov 29 '12 at 22:44
add comment

Using AutoHotkey, if the mouse back and forward buttons are already mapped by the user for a different purpose, lukescammell's solution can be modified to use Browser_Back and Browser_Forward instead:

#IfWinActive, ahk_class Notepad++
; Switch to the adjacent tab to the left
^PgUp::
    Send, {Browser_Back}
    Return
; Switch to the adjacent tab to the right
^PgDn::
    Send, {Browser_Forward}
    Return

These are extra media buttons found on some multimedia keyboards for going back and forward in a Web browser.

share|improve this answer
add comment

Your Answer

 
discard

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