Skip to content

Conversation

@kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Oct 22, 2025

Changes default Go to Line shortcut to Ctrl+G (except on macOS)

This is for consistency with other IDEs. VSCode, Rider, Kate, and Sublime Text all use Ctrl+G for Go to Line.

On macOS it is sometimes Cmd+G, but it seems like it is Cmd+L is more common, so I added an override for it to keep the same shortcut as before.
But I can change it here too if we want.

editor/group_selected_nodes also uses Ctrl+G, but it didn't work when the Script Editor was open anyway, and it still works in the 2D/3D editors now.

@kitbdev kitbdev added this to the 4.x milestone Oct 22, 2025
@kitbdev kitbdev requested a review from a team as a code owner October 22, 2025 01:15
@Ivorforce
Copy link
Member

As a long time macOS user, cmd + l is "go to line", and cmd + g is "go to next search result". So I think you made the right call there.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. Code looks good to me.

On macOS it is sometimes Cmd+G, but it seems like it is Cmd+L is more common

To accomodate for this, you could bind it to both Ctrl + G and Ctrl + L on all platforms with ED_SHORTCUT_ARRAY(). We don't have any conflicts while in the script editor currently.

This is also good for muscle memory if you regularly switch between macOS and other platforms (like yours truly).

@kitbdev kitbdev force-pushed the goto_line_shortcut_update branch from cf06bd0 to 4f4046f Compare October 22, 2025 23:59
@kitbdev kitbdev changed the title Change Go to Line default shortcut to Ctrl+G Add Go to Line default shortcut Ctrl+G Oct 23, 2025
@kitbdev
Copy link
Contributor Author

kitbdev commented Oct 23, 2025

Updated to use both

@Ivorforce
Copy link
Member

Ivorforce commented Oct 23, 2025

I'd rather use cmd + g open for "Go to next match" shortcut. It's one I use all the time in other apps.

I understand trying to match shortcuts across OSs, but personally, I think it's more important to match expected behavior within the OS. But I've met a lot of people who feel different about that 😅 do we have a policy for it?

@kitbdev
Copy link
Contributor Author

kitbdev commented Oct 23, 2025

It looks like Find next is set to Meta + G, (and Find Previous is Meta + Shift + G).
I think that Meta is actually the Command key?
So it looks like there is actually a conflict here.

@Ivorforce
Copy link
Member

Ivorforce commented Oct 23, 2025

Oh yea, looks like cmd + g actually is already "find next". When I wrote my comment, I searched the shortcuts and didn't find anything, no idea why I didn't just try pressing the buttons 😅

I think that Meta is actually the Command key?

Yes!

@kitbdev kitbdev force-pushed the goto_line_shortcut_update branch from 4f4046f to d08d9d3 Compare October 23, 2025 15:29
@kitbdev kitbdev changed the title Add Go to Line default shortcut Ctrl+G Change Go to Line default shortcut to Ctrl+G Oct 23, 2025
@kitbdev
Copy link
Contributor Author

kitbdev commented Oct 23, 2025

Changed back to Ctrl+G as default and Cmd+L override on mac.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, given the above comments.

@Ivorforce Ivorforce modified the milestones: 4.x, 4.6 Oct 23, 2025
@Ivorforce
Copy link
Member

I'm not sure what our policy is for editor shortcut compatibility, but for me it makes sense to change to something users are more likely to be used to.

@Calinou
Copy link
Member

Calinou commented Oct 23, 2025

I'm not sure what our policy is for editor shortcut compatibility, but for me it makes sense to change to something users are more likely to be used to.

Historically, we try to follow what other popular code editors do by default (mainly Visual Studio Code, as it often comes first in developer surveys).

@Repiteo Repiteo merged commit 2aa3f92 into godotengine:master Oct 23, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 23, 2025

Thanks!

@kitbdev kitbdev deleted the goto_line_shortcut_update branch October 23, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants