This shortcut instantly made me a 10x gamedev

I accidentally discovered that CTRL+D selects the next occurrence for multi-line-editing.
I have been using it non-stop since my discovery…
Did you guys know about it?

12 Likes

This is one of those features I always saw others use, especially in VS Code, but I was always too lazy to actually look up the shortcut to do it, or when I did, I also forgot about it in just a few days. It’s great though!

3 Likes

OMG that’s so cool! Now I just need to remember the next time I need it. Still wish there was a refactor command though.

2 Likes

True, I’d love to have a proper refactor command. CTRL+SHIFT+R is close, but not quite there.

1 Like

LoL,I figured it out when just messing around with keyboard shortcuts, It’s cool when you have to change the int to float :eyes:

2 Likes

Yeah, I use CTRL+SHIFT+F a lot to find references.

1 Like

The problem is remembering to use it when I need it. Lol

4 Likes

This seems so cool! I’ve been using control+ F but now knowing this it will certainly speed up refactoring!

1 Like

Nice, this is going to help.

I dislike that the standard shortcut for this is Ctrl+D, while duplicating a line/text, which I need far more often, is Ctrl+Shift+D. I feel this should be switched, especially as other editors use Ctrl+D for line duplication afaik.

You can change this.

  1. Go to Project → Project Settings.
  2. Click on the Input Map tab.
  3. Click the Show Built-in Actions check button so it is on.
  4. Click the Filter by Event textbox in the upper right corner. (The text will change to Listening for Input.)
  5. Press Ctrl+D.
  6. Change ui_text_add_selection_for_next_occurence to Ctrl+Shift+D
  7. Press the Close button.
  8. Go to Editor → Editor Settings.
  9. Click on the Shortcuts tab.
  10. Click the Filter by Event textbox in the upper right corner. (The text will change to Listening for Input.)
  11. Press Ctrl+Shift+D.
  12. Change ui_text_add_selection_for_next_occurence to Ctrl+Shift+D
  13. Click the expand left arrow next to Duplicate Selection.
  14. Change the Primary entry to use Ctrl+D.

NOTE: The second change to the editor settings will affect every project, but the first one will have to be made for each new project. Though you could make a plugin script to make that happen when it is enabled. If you want to do this, check out this plugin code.

1 Like

That’s why I use VS Code instead of the built-in editor. It works a lot better than you’d think once you’ve set it up with the plugin! You can even drag & drop from the plugin scene side panel just like with the regular editor. Only a couple minor issues with syncing changes which I hope get worked out soon.

To set it up, I followed this post on Reddit:

How to get VSCode working nicely with Godot and GDScript

1 Like

That’s good to know. I actually stopped using VSCode because I couldn’t do that.

However at this point if I were going to switch to an external editor, it would be JetBrains Rider. I always prefer JetBrains’ IDEs over VSCode.

For now though, I’m sticking with the Godot editor because they keep making it better. The fact that I can hover over something and get the documentation as a pop-up saves me so much time.