When we develop a game, especially a big one, sometimes it may often happen that we can never find the scene which we want to edit or we cannot remember where the script file is, which we are going to edit.
In this article, I am going to introduce some so powerful and useful search features with keyboard shortcuts. Once you know those, you can reduce the huge amount of time looking for something which may be the most uninteresting in the game development. In addition, you can use the search features in a much faster way instead of looking for a script file and clicking it in the file system dock, for example.
By the way, we can see all default shortcuts in the official online documents of Godot. Be careful about that it says Alt as Option on macOS.
GODOT DOCS
Default editor shortcuts
Anyway, why do not you try to use the searches because it is sure to improve work efficiency.
I will introduce ones in order of the widest range of searches first.
Quick Open
To use Quick Open, perform the following keyboard shortcut on Godot editor. Be careful, it does not work on script editor so you need to switch to 2D or 3D Workspace if you use it.
Windows: Shift + Alt + O
macOS: Shift + Option + O
For example, we rarely memorize the names of all the imported files so it must be faster to use Quick Open than to look for a file visually to find one from them.
The range of Quick Open search is all files. This means it includes sound files, texture files, font files, scene files, and script files. We can search them with the keyword of the files’ extensions or the part of the files’ names.
We can also use this search feature to access a specific file quickly instead of directly finding and clicking it in the file system dock.
Quick Open Scene
To use Quick Open Scene, perform the following keyboard shortcut on Godot editor.
Windows: Ctrl + Shift + O
macOS: Cmd + Shift + O
Quick Open Scene is very similar to Quick Open which I introduced firstly. The difference is the range of search of Quick Open Scene is narrower than Quick Open. It means the range is limited to scene files.
Quick Open Script
To use Quick Open Script, perform the following keyboard shortcut on Godot editor.
Windows: Ctrl + Alt + O
macOS: Cmd + Option + O
The UI of Quick Open Script is also similar to Quick Open. The range of search of Quick Open Script is limited to script files.
It is really hard to find a script file from the sidebar of the script editor section in Godot editor after we made a lot of files. In addition, the situation tends to get much worse if we open many official documents there. It is a pain to find one visually even if the files are sorted in the alphabet. Therefore it would be better to use Quick Open Script.
Find in Files
To use Find in Files, perform the following keyboard shortcut on the Godot editor while you open the script editor.
Windows: Ctrl + Shift + F
macOS: Cmd + Shift + F
This is a feature of the script editor. You can find a keyword in multiple script files at once. The search results will be shown in the “Search Results” panel which is placed at the bottom of the Godot editor. You can, then jump to the exact place of the word in the script which you choose if you click one from the list of the result of hits in the panel.
You can also search with filtering by a folder name. To do so, you just type the folder path in the box below the box of the keyword.
In addition, we can replace all the hit items with another word at once.
Firstly, input a keyword and then click the replace button.
After that, just do the following steps in the Search Result panel.
- Tick some of the search results which you want to replace.
- Input the word with which you want to replace.
- Click Replace all button. Just make sure that this operation has no undo.
Find
To use Find feature, perform the following keyboard shortcut on the Godot editor while you open the script editor.
Windows: Ctrl + F
macOS: Cmd + F
This is the narrowest search feature. We can search a keyword in a script. It might be a more common way of using this to move to the specific variable or function in a script, instead of looking for a word that is hard to be found.
Find and Replace
To find a word and replace with another word, perform the following keyboard shortcut on the Godot editor while you open the script editor.
Windows: Ctrl + Alt + F
macOS: Cmd + Option + F
We can find a word and replace it with another word just by changing the key combination of the shortcut. It is useful for replacing a word such as a variable name or a function name that is only used in a specific script.
Conclusion
In this article, we introduced the Godot editor’s convenient search function. All of the shortcut operations require some getting used to at first, but once your hands learn the key combinations, you will be able to work at high speed. We encourage you to use them.
UPDATE
2022/05/29 Transfered this article from “Posts” to “Tutorials”