Note: On mac, I had to use /private/tmp, not /tmp, as /tmp by itself will redirect to that.
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.
Check the language server port, by default in Godot 4.2 it's 6005
Tick Show Native Symbols in Editor
Check the port, by default in Godot 4.2 it's 6006
Tick Synchronize Breakpoints
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"),
})
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,
},
}
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
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