Michael Moussa
Michael Moussa

Reputation: 4307

How do I get NetBeans to stop using MRU style tabbing when switching between editors using CTRL+TAB?

I am accustomed to CTRL+TAB / SHIFT+CTRL+TAB switching to the next and previous tabs, respectively, in the order in which they appear on the tab bar. NetBeans does it MRU style, where CTRL+TAB will take you to whatever was the last file you were editing.

This often breaks my flow in that I need to keep tabbing and checking if I'm on the right file before continuing rather than just instinctively hitting CTRL+TAB+TAB+TAB because I know the file I want to go to is 3 tabs over on the tab bar.

The default CTRL+PAGEUP / CTRL+PAGEDOWN keymaps behave exactly how I want CTRL+TAB and SHIFT+CTRL+TAB to behave, but changing the mappings to CTRL+TAB don't seem to make a difference - it ignores my keymapping and continues using MRU.

How can I change this behavior?

Upvotes: 6

Views: 460

Answers (1)

Michael Moussa
Michael Moussa

Reputation: 4307

Resolved the issue myself. The solution is to use AutoHotKey to map CTRL+TAB / SHIFT+CTRL+TAB to CTRL+PAGEDOWN and CTRL+PAGEUP, respectively. This will prevent NetBeans from hijacking CTRL+TAB / SHIFT+CTRL+TAB to use MRU despite them having been remapped.

AutoHotKey script below:

SetTitleMatchMode, 2 ; So that we can partial match window title

; Fix MRU in NetBeans
#IfWinActive, NetBeans IDE
    ; CTRL+TAB
    ^Tab::SendInput ^{PgDn}
    return

    ; SHIFT+CTRL+TAB
    +^Tab::SendInput ^{PgUp}
    return
#IfWinActive

Hope this will be useful for someone!

Upvotes: 8

Related Questions