Go to definition without using the mouse

Godot Version

4.3

Question

ctrl + left a class or a function will move you to the script that it was declared in. Is there a way to do this action with the keyboard only. I couldn’t find anything else other than contextual help which is alt + f1. which is almost what I want but it doesn’t go into the script it goes into the auto generated documentation.

You might check the built-in input map. Just go to Project → Project Settings → Input Map and click the Show Built-in Actions toggle. All the keyboard shortcuts are there. More importantly you can modify/add your own shortcuts to those actions. I do not know if the documentation jump is there, but you can check.

In 4.4 beta-1+ hovering over things now gives you info without having to click, so there might be more keyboard controls too.

IIRC The Editor Settings → Command Pallet is where you would find keybindings like this and as you have noticed, there is none.

I think this is another, not implemented yet thing but seems like a good feature request to get into the keybinding command pallet.

EDIT: My bad it’s Editor Settings → Shortcuts

The Action feature would be Lookup Symbol.

I wonder why it’s not in the actions list in the Shortcut editor. I might look into this further.

1 Like

It’s there.

  1. Open Editor → Editor Settings.
  2. Click on the Shortcuts Tab.
  3. It’s under Editor → Online Documentation and Property Editor → Open Documentation. The values are currently unset.

Yeah That is the documentation, it opens at the class level.

I thought the OP was asking about clicking on a method/property that would take you to the symbol definition, which Open Documentation doesn’t as far as I can see.

The symbol would be an anchor tag in the HTML.

If you right click on a method / property call you can see Lookup Symbol which takes you to the symbol’s anchor tag in the HTML document.

I couldn’t find that in the shortcut list is what I was saying.

(If we had this shortcut, you could open a method or property signature without the mouse)

Ah, ok. I thought Open Docs did that, but you’re right for just finding stuff you made, you need Lookup Symbol.

1 Like

This shortcut should be present in the Editor Settings’ Shortcuts tab in 4.4.beta3:

Note that no default is assigned to it yet.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.