83

I have some kind of weird behavior in Netbeans. I guess I accidentally entered some key combination which messed up the cursor and selection behavior. In the image you'll see what I mean: normally, if you select text across multiple lines, you'll see the behavior on the right screenshot.

But I have the behavior on the left screenshot. Also, trying to insert text at a certain position with Shift, inserts it some positions to the right (= not where the cursor is). Additionally, when the cursor blinks, it appears dashed.

Netbeans comparison

The fact that the selection in the left screenshot is drawn nicely doesn't make me think of a bug, but rather of a feature. I can't seem to find the key combination to turn it off again.

So my question is, what is this feature? Why does it exist and with what key combination did I turn it on?

halfer
  • 19,824
  • 17
  • 99
  • 186
Timmos
  • 3,215
  • 2
  • 32
  • 40

2 Answers2

179

One possibility is you have the Rectangular Selection plugin installed.

However, the more likely candidate is the rectangular selection feature in the editor core. Find the button on your edit toolbar, and toggle it off. As per helpful comments below, this can accidentally be switched on (and toggled back off again) using:

  • On Windows and Linux: Ctrl + Shift + R
  • On Mac: Shift + Meta + R
  • On Mac, if the above does not work: some folks have reported that Shift + Command + R worked for them
halfer
  • 19,824
  • 17
  • 99
  • 186
  • 14
    Indeed it must be this. Toggle key combination is CTRL + SHIFT + R. Thx! – Timmos Jan 26 '13 at 09:50
  • 1
    On a Mac this is Shift-Meta-R (aka Shift-Option-R) – mlathe Sep 16 '14 at 20:20
  • 1
    For those on PhpStorm, the shortcut is `Alt` + `Shift` + `Insert`. The menu option is `Edit -> Column Selection Mode`. – Bing Oct 04 '16 at 21:10
  • 2
    Thanks! Ctr + Shift + R fixed it! – vasigorc Dec 23 '17 at 15:53
  • @Ian, thanks. Would you find out if that is a change that is worth recording, or whether that is just particular to your system? I have Meta + Shift + R for Macs above - I can't remember if Meta and Command are the same thing on Mac hardware? It's been a few years since I touched a Mac. – halfer Apr 12 '18 at 15:05
  • @halfer - I've checked my default Keymap in Netbeans 8.2 and it reads: Toggle Rectangular Selection = Shift+Command+R. Maybe it is an official change for 8.2? – Ian Newland Apr 12 '18 at 19:33
  • Possibly @Ian - I've added it as another option in my answer. Thanks! – halfer Apr 12 '18 at 19:38
  • [WIN10 Netbeans 8.0.2] "CTRL+SHIFT+R" worked, thank you! so annoying! – OG Sean Jul 10 '18 at 19:52
  • 1
    Ctrl + Shift + R is a shortcut for refreshing browser/chrome. And this has happened to me that while shifting windows, netbeans to chrome, I mistaken run Ctrl+Shift+R on netbeans instead of chrome. Now I found this answer, that exactly is the solution. Thanks.. upvoted... – MSQ Apr 07 '21 at 12:00
  • This Ctrl+Shift+R can be used for writing multiple lines with the same content. Make a selection of multiple lines, then start writing. it will write same character on every line till where the selection is made. Its like when you double-click on a text/variable to highlight, and then press Ctrl+R to refactor, and then write new text in selection, and it will automatically change the text at every instance. It can be turned off by again pressing Ctrl+Shift+R – MSQ Apr 07 '21 at 12:10
  • *crying emoji* Toggle key combination is CTRL + SHIFT + R worked for me ubuntu. Thanks tons helped me a lot – Drishti Jain Jan 19 '23 at 10:52
11

This key combination (Ctrl+Shift+R) is used to open types etc. in Eclipse, so when switching to Netbeans many people will get stuck with this.

halfer
  • 19,824
  • 17
  • 99
  • 186
Richard Day
  • 121
  • 2
  • 3
  • 1
    This is not really an answer to the question. Plus: if you are used to the Eclipse shortcuts, you can easily switch to them with just a few clicks –  Oct 02 '14 at 19:31