Skip to content

Instantly share code, notes, and snippets.

@tsraveling
Last active August 1, 2025 01:10
Show Gist options
  • Save tsraveling/166d3f0970c6a7217754d0619471d320 to your computer and use it in GitHub Desktop.
Save tsraveling/166d3f0970c6a7217754d0619471d320 to your computer and use it in GitHub Desktop.
Set up Godot with Nvim

Editor Settings

Note: On mac, I had to use /private/tmp, not /tmp, as /tmp by itself will redirect to that.

1. In Text Editor>External

Tick Use External Editor

Set Execution Path to your neovim binary

Set Execution Parameters to --server /tmp/godot.pipe --remote-send "<esc>:n {file}<CR>:call cursor({line},{col})<CR>"

Note: you can set the path to the pipe to anything you want. I set it in tmp for convenience.

2. In Networking>Language Server

Check the language server port, by default in Godot 4.2 it's 6005

Tick Show Native Symbols in Editor

3. In Networking>Debug Adapter and NOT "Debugging"

Check the port, by default in Godot 4.2 it's 6006

Tick Synchronize Breakpoints

Neovim Config

1. Install nvim-lspconfig and nvim-dap using your preferred package manager

Configure GDScript lsp like this. Make sure the port you set is the same as in the editor for language server.

require("lspconfig")["gdscript"].setup({
    name = "godot",
    cmd = vim.lsp.rpc.connect("127.0.0.1", "6005"),
})

3. Configure nvim-dap like this. Check the port again

local dap = require("dap")
dap.adapters.godot = {
	type = "server",
	host = "127.0.0.1",
	port = 6006,
}

dap.configurations.gdscript = {
	{
		type = "godot",
		request = "launch",
		name = "Launch scene",
		project = "${workspaceFolder}",
		launch_scene = true,
	},
}

4. Configure file format settings

Make /after/ftplugin/gdscript.lua:

vim.o.tabstop = 4 -- A TAB character looks like 4 spaces
vim.o.expandtab = false -- Pressing the TAB key will insert spaces instead of a TAB character
vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character
vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting
vim.o.commentstring = "# %s" -- add comment support

Starting Neovim

In order for Godot to redirect neovim to the scripts when you click them in the editor, you will always have to start neovim with these arguments.

You can create a custom bash script that you set to your path. I created a script called gdvim that I use when I develop with godot.

nvim --listen /tmp/godot.pipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment