Break free from Godots built-in editor prison and fly!
With godot 4 comes dap integration, which is much better than my solution https://github.com/mfussenegger/nvim-dap
Minimalist Godot debugging tool for nvim. Run your application in debug, break on error or cursor. Works with godot 3 and 4.
Any plugin manager will do.
use('lommix/godot.nvim')
Plugin adds the following commands:
:GodotDebug :GodotBreakAtCursor :GodotStep :GodotQuit :GodotContinue
Here is my example configuration. Make sure to pass the correct path to the godot executable.
--godot.lua
local ok, godot = pcall(require, "godot")
if not ok then
return
end
-- default config
local config = {
-- bin = "godot",
-- gui = {
-- console_config = @config for vim.api.nvim_open_win
-- },
}
godot.setup(config)
local function map(m, k, v)
vim.keymap.set(m, k, v, { silent = true })
end
map("n", "<leader>dr", godot.debugger.debug)
map("n", "<leader>dd", godot.debugger.debug_at_cursor)
map("n", "<leader>dq", godot.debugger.quit)
map("n", "<leader>dc", godot.debugger.continue)
map("n", "<leader>ds", godot.debugger.step)
its pretty simple with nvim remote
create a bash script, make it executeable. add the following context:
#!/bin/bash
[ -n "$1" ] && file=$1
nvim --server ~/.cache/nvim/godot.pipe --remote-send ':e '$file'<CR>'
Now start nvim in your project folder and listen to the pipe file:
nvim --listen ~/.cache/nvim/godot.pipe .
Since you probably dont want to type out that huge path, each time you want to start nvim, make it another bashscript and add it to your globals. On my systems its simple named "gvim".
Add external config to your editor settings with the path to the first script:
Done! if you click on the script icon in godot, nvim will open the file. Have fun!