A Neovim plugin that seamlessly integrates Godot for GDScript development, debugging, and more — all without leaving Neovim’s powerful editing environment.
godotnvim.webm
-
Debugging:
- Attach to Godot to debug your scene.
- Break on cursor or on runtime errors.
- Step, continue, quit — all from within Neovim.
-
Godot 3 & 4 Support:
- Works with older Godot 3 projects or the latest Godot 4 DAP integration.
-
Language Server (LSP):
- Includes a simple setup for GDScript LSP (via
lspconfig).
- Includes a simple setup for GDScript LSP (via
-
Treesitter Integration:
- Basic grammar highlighting for
gdscript,godot_resource, andgdshaderfiles.
- Basic grammar highlighting for
-
Watchers and Console:
- On break, open a watcher window that shows local variables, globals, members, and a trace.
- A separate console window logs information from the running Godot process.
- Neovim 0.7+ (for Lua-based config)
- nvim-dap for debugging (optional, but strongly recommended)
- nvim-treesitter for syntax highlighting (optional but recommended)
- nvim-lspconfig for GDScript LSP (optional but recommended)
- A local Godot executable (
godotorgodot4, etc.)
Use your favorite plugin manager. For example, with lazy.nvim:
{
"lommix/godot.nvim",
lazy = true,
cmd = { "GodotDebug", "GodotBreakAtCursor", "GodotStep", "GodotQuit", "GodotContinue" },
},In your Neovim configuration, create a file or directly place:
{
-- Path to your Godot executable
bin = "godot",
-- DAP configuration
dap = {
host = "127.0.0.1",
port = 6006,
},
-- GUI settings for console (passed to nvim_open_win)
gui = {
console_config = {
anchor = "SW",
border = "double",
col = 1,
height = 10,
relative = "editor",
row = 99999,
style = "minimal",
width = 99999,
},
},
-- Expose user commands automatically (optional)
expose_commands = true,
}Commands (if expose_commands = true or if you call godot.debugger.expose_commands() manually):
:GodotDebug– Launch Godot in debug mode.:GodotBreakAtCursor– Launch Godot and break at the current cursor line in a.gdfile.:GodotStep– Step to the next instruction.:GodotContinue– Continue execution after a break.:GodotQuit– Quit the current debug session.
In addition, the plugin creates two special windows on break:
- A console window showing log output.
- A watcher window displaying current locals, globals, and trace data.
Feel free to open issues or submit pull requests to enhance this plugin.
MIT © 2023 Contributors
