The Godot + Neovim (LazyVim) Setup That Covers (Almost) Everything
1. Intro.
I love the Godot game engine. I (think?) I love Neovim...I am still learning it. What I would really love is if they worked well together! I have a bunch of requirements:
- Autocomplete.
- The (fantastic) Godot documentation must be readable in Neovim.
- I can run a Godot scene from Neovim.
I found several blog posts on the subject, but none of them fully fulfilled my requirements. Fear not, I have found a solution! This solution is a Frankenstein solution from a few blog posts plus some of my own innovations.
This is designed to work with the setup LazyVim provides.
Blog posts to check out.
I adapted, or just straight up copied, some of the solution from these blog posts. I've indicated where I've done this.
- https://alicegg.tech/2024/11/01/godot-nvim
- https://simondalvai.org/blog/godot-neovim/
2. Setting up Godot to work with Neovim.
You need to set the following fields in the Godot editor, this allows Neovim and Godot to communicate with each other via a pipe file in the project. We will use this later.
Text Editor > External > Exec Path = /opt/homebrew/bin/nvim (or your nvim install)
Use which nvim to find this path.
Text Editor > External > Exec Flags = --server {project}/server.pipe --remote-send "<C-\><C-N>:e {file}<CR>:call cursor({line}+1,{col})<CR>"
This tells Godot how to open Neovim on the correct file and line. I normally just open Neovim in the project manually, although this can be used to open a file in an existing Neovim instance from Godot.
Text Editor > External > Use External Edit = True

I borrowed most of this from this blog post.
3. A nice piece of code.
I didn't want to run Nvim with a bunch of flags, but I'd prefer Nvim to just figure this out itself. This piece of code was adapted from this blog post.
Add this to your ~/.config/nvim/init.lua.
-- Function to find Godot project root directory
local function find_godot_project_root()
local cwd = vim.fn.getcwd()
local search_paths = { '', '/..' }
for _, relative_path in ipairs(search_paths) do
local project_file = cwd .. relative_path .. '/project.godot'
if vim.uv.fs_stat(project_file) then
return cwd .. relative_path
end
end
return nil
end
-- Function to check if server is already running
local function is_server_running(project_path)
local server_pipe = project_path .. '/server.pipe'
return vim.uv.fs_stat(server_pipe) ~= nil
end
-- Function to start Godot server if needed
local function start_godot_server_if_needed()
local godot_project_path = find_godot_project_root()
if godot_project_path and not is_server_running(godot_project_path) then
vim.fn.serverstart(godot_project_path .. '/server.pipe')
return true
end
return false
end
-- Main execution
start_godot_server_if_needed()
It scans for the project.godot file, and if it finds it, then it connects to the LSP language server provided by the Godot engine using the pipe file that Godot adds to your project. This just worksâ„¢ in LazyVim, so autocomplete will be set up.

4. Install some plugins, clean up snacks.
If you're using LazyVim just throw this into your nvim config. I put these in ~/.config/nvim/lua/plugins/godot.lua.
return {
{ "habamax/vim-godot" },
{ "skywind3000/asyncrun.vim" },
{ "teatek/gdscript-extended-lsp.nvim", opts = { view_type = "floating", picker = "snacks" } },
{
"folke/snacks.nvim",
opts = {
picker = {
sources = {
explorer = {
hidden = true, -- show hidden files
ignored = false, -- don't show gitignored files
exclude = { -- exclude specific patterns
"*.uid", -- glob pattern for files ending with .uid
"server.pipe", -- exact filename match
},
},
},
},
},
},
}
vim-godot
This plugin provides:
- Syntax highlighting.
- Run scenes from Nvim (using
:GodotRun), this requires theasyncrunplugin to work properly.
teatek/gdscript-extended-lsp
This one is my favourite. This allows you to open the Godot documentation from within Nvim using gD while on a symbol.

Snacks configuration.
The final part just hides the annoying .uid files which are auto-generated by Godot. It also hides the server.pipe file - which Godot creates for the LSP connection - by adding some config to the snacks plugin. The snacks plugin comes with LazyVim.
5. Conclusion.
I have massively enjoyed using Nvim to write GDScript code. Sadly, you'll still need Godot open to provide the language server and the scene tree/UI editor, but this allows you to write code with full parity with what the built-in editor provides.
This is really awesome, and it shows how great the open source community is.