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.
- Connect to Godot editor LSP over TCP (
127.0.0.1:6005
by default) - Full GDScript language support
.gdshader
syntax highlighting via Treesitter- Debug GDScript with
nvim-dap
(127.0.0.1:6006
by 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
- Neovim 0.9+
- Godot 4.x+ with TCP LSP enabled
nvim-lspconfig
nvim-dap
andnvim-dap-ui
for debuggingnvim-treesitter
- Windows users must have
ncat
in PATH - Optional C# support requires:
- .NET SDK (dotnet)
- C# LSP server (csharp-ls recommended or omnisharp)
- netcoredbg debugger
{
'Mathijs-Bakker/godotdev.nvim',
dependencies = { 'nvim-lspconfig', 'nvim-dap', 'nvim-dap-ui', 'nvim-treesitter' },
}
- Open your Godot project in Neovim
- Start Godot editor with TCP LSP enabled (Editor Settings → Network → Enable TCP LSP server)
- Open a
.gd
or.gdshader
file - LSP will automatically attach
- Use
<leader>rn
to rename,gd
to go to definition,gr
for references, etc. - Start debugging with DAP (Launch scene configuration)
- Optional: Enable C# support by setting
csharp = true
in the plugin setup - Run
:checkhealth godotdev
at any time to verify plugin, LSP, debug server, and C# dependencies
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
})
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
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.
-
Create a launch script (e.g., ~/.local/bin/open-nvim-godot.sh):
#!/bin/bash FILE="$1" LINE="$2" COL="$3" /Applications/Ghostty.app/Contents/MacOS/ghostty -- nvim "$FILE" +"$LINE:$COL" # Linux: gnome-terminal -- nvim "$FILE" +"$LINE:$COL"
-
Make executable:
chmod +x ~/.local/bin/open-nvim-godot.sh
-
Add to PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
-
Configure Godot:
Editor > Editor Settings > Text Editor > External
with full path and{file} {line} {col}
. -
To make this work you always need to start Neovim like this:
nvim --listen /tmp/godot.pipe
Tip! Create an alias for that command.
Open your shell config file:
~/.bashrc
for Bash~/.zshrc
for Zsh
Add the alias:
alias gdvim='nvim --listen /tmp/godot.pipe'
Reload the shell config:
source ~/.bashrc # or ~/.zshrc for Zsh
Test it:
gdvim
- 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.
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
F5
-> Continue/StartF10
-> Step overF11
-> Step intoF12
-> Step out<leader>db
-> Toggle Breakpoint<leader>dB
-> Conditional breakpoint
<leader>du
-> , Toggle UI<leader>dr
-> , Open REPL
- Enable by setting
csharp = true
inrequire("godotdev").setup()
- Health checks via
:checkhealth godotdev
will verify:- .NET SDK (
dotnet
) - C# LSP server (
csharp-ls
oromnisharp
) - Debugger (
netcoredbg
)
- .NET SDK (
Godot expects spaces, 4 per indent (for both GDScript and C#). If you see diagnostics like:
Used tab character for indentation instead of space as used before in the file. [-1] [-1]
You should configure indentation properly.
It's recommend adding an .editorconfig
to your project.
For more info: :help godotdev-indent