Tiny Roosters Text Alt Logo

< Godot Script Switcher Plugin

Project: Godot Script Switcher Plugin - Header Image
|
Plugin for the Godot Game Engine to implement VSCode's Quick Open for MRU files created with godot-cpp.

Description

This is a plugin for the Godot Game Engine created with godot-cpp that provides quick switching between recently opened scripts using a currently hardcoded keyboard shortcut: Ctrl + Tab. This is a recreation of VSCode’s Quick Open for MRU (Most Recently Used) files, improving workflow efficiency for developers who are familiar with this … workflow. Mainly just a pain point for me working in Godot - and that’s all that matters.

Features

Usage

Once the plugin is enabled, you can use the following keyboard shortcuts:

NOTE: the second item in the list (the previously active script) will be selected, allowing for quick toggling between your two most recent scripts.

Technical Details

This plugin is implemented in C++, using Godot’s GDExtension with godot-cpp bindings for blazingly fast performance and deep integration with the Godot editor. Also I wanted to.


The ScriptSwitcher class tracks script changes by binding to the ScriptEditor::editor_script_changed signal, updating a MRU history variable stored as a vector type. It overrides the global _inputs method to listen for Ctrl + Tab combinations and only displays the quick-open popup if the script editor is active. The popup UI is designed in Godot and saved to a .tscn file and dynamically loaded in when the plugin is enabled.