How to use Neovim as External editor for Godot (Godot executable permissions)

2.1k Views Asked by At

I am trying to configure Godot to use launch Neovim in iTerm2 when I double click on a file containing code in the editor, however, a terminal window pops up instead with the following error:

/Users/myusername/.../Scripts/Player.gd; exit zsh: permission denied: /Users/.../Scripts/Player.gd

This error message quickly goes away before I can read it and I am presented with an empty neovim window but it hasn't opened the file I clicked on. Additionally, the current working directory for the neovim window is my home directory (not the directory the project is based in)

I am running macOS Catalina with iTerm2 and Godot 3.2.2. My settings to open neovim in

Editor->Editor Preferences->Text Editor->External: "exec path":iTerm2 executable (I tried pointing to the actual nvim executable, but that didn't seem to work).
exec flags: "nvim {file}".

My understanding is that this should open iTerm and execute the command "nvim [insert filename here]", opening Neovim.

I tried some solutions, including creating a neovim.desktop file, however, nothing seems to work. If anyone has any suggestions as to how I can give Godot the correct permissions I'd love to hear it. Please let me know if you need anything else.

Thank you!

1

There are 1 best solutions below

0
On

Ok, after a bit of fiddling, I have the info using docs (https://docs.godotengine.org/en/stable/tutorials/editor/external_editor.html) the first value you want is only the executable path. in this case it would be your iterm2 path.

EVERYTHING ELSE GOES IN YOUR FLAGS

Example for me Exec Path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.18.2822.0_x64__8wekyb3d8bbwe\wt.exe

Exec Flags: powershell -c nvim {file}

I still have to Iron out a few bugs, like the path being interpreted as multiple files (powershell likes paths in quotation marks and I think godot just sends WO them).