Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ide

netbeans

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?

like image 720
Michael Moussa Avatar asked Aug 08 '11 16:08

Michael Moussa


People also ask

How do you tab in Netbeans?

To make Netbeans tab for 4 spaces: press "Tools" -> "Options" -> "Formatting". There should be a text field "Tab size" to set the tabbing size (see image bellow). Save this answer.


1 Answers

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!

like image 195
Michael Moussa Avatar answered Sep 18 '22 13:09

Michael Moussa