godotdev.nvim
Neovim plugin for Godot game development, using Neovim as an external editor. Provides LSP support for GDScript and Godot shaders, DAP debugging, Treesitter syntax highlighting, and optional C# installation support.
Features
- Connect to Godot editor LSP over TCP (
127.0.0.1:6005by default) - Full GDScript language support
.gdshadersyntax highlighting via Treesitter- Debug GDScript with
nvim-dap(127.0.0.1:6006by default) - Keymaps for common LSP actions
- Optional C# support: LSP, debugging, and tooling
- Batteries included: everything you need for Godot development in Neovim
- Built-in health checks via
:checkhealth godotdev
Requirements
- Neovim 0.11+
- Godot 4.x+ with TCP LSP enabled
nvim-lspconfignvim-dapandnvim-dap-uifor debuggingnvim-treesitter- Windows users must have
ncatin PATH - Optional C# support requires:
- .NET SDK (dotnet)
- C# LSP server (csharp-ls recommended or omnisharp)
- netcoredbg debugger
Installation (Lazy.nvim)
{
'Mathijs-Bakker/godotdev.nvim',
dependencies = { 'nvim-lspconfig', 'nvim-dap', 'nvim-dap-ui', 'nvim-treesitter' },
}
Quickstart
- Open your Godot project in Neovim
- Start Godot editor with TCP LSP enabled (Editor Settings → Network → Enable TCP LSP server)
- Open a
.gdor.gdshaderfile - LSP will automatically attach
- Use
<leader>rnto rename,gdto go to definition,grfor references, etc. - Start debugging with DAP (Launch scene configuration)
- Optional: Enable C# support by setting
csharp = truein the plugin setup - Run
:checkhealth godotdevat any time to verify plugin, LSP, debug server, and C# dependencies
Configuration
Optional settings
require("godotdev").setup({
editor_host = "127.0.0.1", -- Godot editor host
editor_port = 6005, -- Godot LSP port
debug_port = 6006, -- Godot debugger port
csharp = true, -- Enable C# Installation Support
autostart_editor_server = true, -- Enable auto start Nvim server
})
Optimize Godot editor for Neovim
Below are the recommended settings for configuring the Godot editor for optimal integration with Neovim as your external editor. To access these settings, make sure that the Advanced Settings switch is enabled at the top of the Editor Settings dialog.
-
Editor Settings > Text Editor > Behavior > Auto Reload Scripts on External Change -
Editor Settings > Interface > Editor > Save on Focus Loss -
Editor Settings > Interface > Editor > Import Resources When Unfocused
Open .gdscript/.gdshader from Godot in Neovim
When you click on a gdscript in Godot's FileSystem dock it doesn't open automatically in Neovim. A workaround is to to create a small script which launches the file in Neovim.
>> macOS/Linux
Complete instructions here
>> Windows
- Set Neovim to listen on a TCP port
--listen works with host:port on Windows.
nvim --listen 127.0.0.1:6666 - Tell Godot to connect to that port
In Godot, configure your external editor or plugin to connect to
127.0.0.1:6666. Make sure the TCP port you choose is free and consistent between Neovim and Godot.
Godot editor server
You can manually start the Neovim editor server used by Godot:
:GodotStartEditorServer
Or automatically on plugin setup:
require("godotdev").setup({
autostart_editor_server = true,
})
This ensures Godot can communicate with Neovim as an external editor.
Reconnect to Godot's LSP server
If the LSP disconnects or you opened a script before Neovim, run:
:GodotReconnectLSP
Reconnects all Godot buffers to the LSP.
Keymaps
LSP
gd→ Go to definitiongD→ Go to declarationgy→ Type definitiongi→ Go to implementationgr→ List referencesK→ Hover<C-k>→ Signature help<leader>rn→ Rename symbol<leader>ca→ Code action<leader>f→ Format buffergl→ Show diagnostics[d/]d→ Previous/next diagnostic
DAP
F5-> Continue/StartF10-> Step overF11-> Step intoF12-> Step out<leader>db-> Toggle Breakpoint<leader>dB-> Conditional breakpoint
DAP UI
<leader>du-> , Toggle UI<leader>dr-> , Open REPL
C# Installation Support
- Enable by setting
csharp = trueinrequire("godotdev").setup() - Health checks via
:checkhealth godotdevwill verify:- .NET SDK (
dotnet) - C# LSP server (
csharp-lsoromnisharp) - Debugger (
netcoredbg)
- .NET SDK (
Autoformatting / Indentation
Godot expects spaces, 4 per indent (for both GDScript and C#).
This plugin automatically sets buffer options for .gd files.
Additionally, .gd files are autoformatted on save with gdformat:
:w
Make sure gdformat is installed and in your PATH. If not, you will see a warning notification.
For more info on indentation: :help godotdev-indent

