Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be πŸ“–

GodotScriptSwitcher

An asset by TinyRoosters
The page banner background of a mountain and forest
GodotScriptSwitcher hero image

Quick Information

0 ratings
GodotScriptSwitcher icon image
TinyRoosters
GodotScriptSwitcher

This plugin 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.

Supported Engine Version
4.6
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
8 hours ago
Git URL
Issue URL

Godot Logo

Godot Script Switcher

Quick switching of open scripts in the ScriptEditor with Ctrl + Tab.

License

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 - so here we are.


Table of Contents

Features

  • Most Recently Used (MRU) Script History: Keeps a list of the scripts you have open.
  • Quick Switch Popup: A compact popup window with recent scripts by their file names.
  • Keyboard-driven Navigation: Navigate and select scripts within the popup using familiar keyboard shortcuts.
  • Contextual Activation: The popup only appears when the Script Editor is the active tab, as that makes sense for a script switcher.
  • Full Path Tooltips: Each script in the list displays its full path as a tooltip.

Todo

  • Add support for Godot Docs in the history.
  • Capture holding keys, not just presses.

Usage

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

  • Trigger the popup:

    • Press Ctrl + Tab and hold Ctrl.
    • A popup will appear, displaying a list of your open scripts, sorted by how recently they were used.
    • Note: the second item in the list (the previously active script) will be selected, allowing for quick toggling between your two most recent scripts.
  • Navigate the List:

    • While still holding Ctrl, press Tab, Down Arrow, or Up Arrow to select a script.
  • Select a script:

    • Release the Ctrl key.
    • The script currently highlighted in the popup will be opened in the Script Editor.

Installation

Note: Not uploaded as of yet.

  1. Open Godot β†’ AssetLib tab
  2. Search "Godot Script Switcher" β†’ Download
  3. In the install dialog, make sure "Ignore asset root" is checked, then click Install
  4. Project β†’ Project Settings β†’ Plugins β†’ Enable Godot Script Switcher
  5. Restart the Editor

Releases (easy)

Head to releases and download whatever version you want. I'll probably have files for Windows/Linux/Mac available there.

  1. Download a release zip.
  2. Extract to your project's addons dir: ../addons/godot-script-switcher.
  3. Enable the plugin:
    1. Project β†’ Project Settings β†’ Plugins
    2. Click to enable Godot Script Switcher

Manual (fun)

You'll have to compile it on your target platform and then enable it in your Godot project. This project requries CMake, GCC, and Ninja is recommended.

  1. Clone the Repository.

    cd godot-scipt-switcher/
    git clone https://github.com/travlee/godot-script-switcher.git .
    
  2. Compiling: This plugin is written in C++ using godot-cpp. You must compile the plugin for your specific OS and architecture using CMake. I use Ninja as the build system, if you use Visual Studio, the output dir will differ so you'll have to combine them into the addons/godot_script_switcher/ dir.

    • From the root of the project, configure the CMake build:
      cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release
      
    • Build the plugin:
      cmake --build build --config Release
      
    • After building, simply copy the ./godot/addons/godot_script_switcher/ dir to your project's ./addons/ dir.
  3. Enable the Plugin in Godot:

    • Project β†’ Project Settings β†’ Plugins
    • Click to enable Godot Script Switcher

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 an 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.

Contributing

If you encounter any bugs, have suggestions for new features, or would like to improve the existing code, please feel free to:

  • Open an Issue: Describe the bug or feature request in detail on the GitHub issue tracker.
  • Submit a Pull Request: Fork the repo, make some changes, and submit a PR.

License

MIT

This plugin 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.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
GodotScriptSwitcher icon image
TinyRoosters
GodotScriptSwitcher

This plugin 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.

Supported Engine Version
4.6
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
8 hours ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers