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?
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With