Thank you. Here is my neovim launcher script updated, to preserve original configuration. That way, you can debug with internal Defold editor, or use neovim as external editor.
Ok, it’s « DIY spirit » , but it’s better than nothing and at least it works
You need to generate two files, in the defold config path:
For neovim, the configuration in Defold preferences is:
Custom editor: /usr/bin/nvr
Open file: --servername /tmp/defold_nvim --remote-tab {file}
Open file at line: {file}:{line}
You will need to install neovim-remote
, which provides the nvr
command.
When you want to debug, just launch Defold
executable.
If you want to use neovim, launch the script below.
#!/bin/bash
projectpath="$PWD"
project="${projectpath}/game.project"
defoldpath="$HOME"/defold
defoldprefs="$HOME"/.java/.userPrefs/defold
nvim_servername="/tmp/defold_nvim"
# must be in Defold directory, otherwise problem for installing updates
# (may be fixed today ?)
cd $defoldpath
# if a nvim session is found, load it.
session_nvim="$projectpath"/session.nvim
if [ -f "$session_nvim" ]; then
session_nvim="-S $session_nvim"
else
session_nvim=""
fi
NVIM_LISTEN_ADDRESS="$nvim_servername" nvim "$session_nvim" -c "au BufEnter,BufNew,BufRead *.script setlocal ft=lua" & #runtime syntax/lua.vim" &
cp "$defoldprefs"/prefs.xml.nvim "$defoldprefs"/prefs.xml
if [ -f "$project" ]; then
./Defold "$project"
else
./Defold
fi
# restore vanilla configuraton
cp "$defoldprefs"/prefs.xml.org "$defoldprefs"/prefs.xml
# and close nvim.
nvr --servername "$nvim_servername" -c 'wqa'