Skip to content

Instantly share code, notes, and snippets.

@SamuelDavis
Last active August 25, 2025 12:10
Show Gist options
  • Select an option

  • Save SamuelDavis/17c151569772cd76be26b9bcb21aff18 to your computer and use it in GitHub Desktop.

Select an option

Save SamuelDavis/17c151569772cd76be26b9bcb21aff18 to your computer and use it in GitHub Desktop.
Start Nvim for Godot; when opening a .gd file in Godot, defer to either a running instance of Neovim if it exists, or a new one.
#!/usr/bin/env bash
# usage: Exec Path: gvim
# Exec Args: {file}
# default lspconfig.gdscript.setup() is fine
SOCK="/tmp/godot.sock"
FILE=${1}
if [ -S "$SOCK" ]; then
nvim --server "$SOCK" --remote "$@"
else
gnome-terminal --active -- nvim --listen "$SOCK" "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment