Defold.nvim - Batteries-included development environment for the Defold game engine, powered by Neovim

Or “How to turn Neovim into a Defold IDE” :slight_smile:

I’ve been wanting to use Neovim with Defold and I couldn’t get other solutions I’ve found to run so I made my own which my brother and I have been using for a while now and I thought its perhaps a good time to share the project.

Features

  • Code Hot-Reloading: Make code tweaks and see them live in Defold, no waiting.
  • Defold Control from Neovim: Run Defold commands right from Neovim with custom shortcuts.
  • LSP Integration: Get Defold API hints and autocomplete in Neovim’s built-in LSP.
  • Dependency Annotations: Auto-load LSP annotations for your Defold dependencies.
  • Debugger: Step through your code and dig into issues with ease.
  • Snippets: Insert pre-made code snippets to save time.

Supports Linux, macOS and Windows although I’m only using Linux so mac and Windows might still be a bit rough. I’ve done some testing in VMs but would appreciate some feedback

Just follow the install and setup instructions in the README and you should be good to go (if not write me a message and I try to get it fixed).

The most annoying part here was getting the debugger to run, the Defold editor is using MobDebug internally so I thought it would be a good idea if we’d use that too which turned out to take a bit of effort. Neovim similar to VSCode uses the Debug Adapter Protocol these days (nvim-dap) so the fastest way was to implement a sort of bridge between MobDebug and Neovim using a custom DAP implementation which you can find here GitHub - atomicptr/mobdap: Debug adapter implementation for Lua / ModDebug which perhaps can be of use for other editor projects god knows :).

12 Likes

Cool! We would like to make Defold compatible with DAP as it’s used in a lot of other IDEs.

2 Likes