From 80c5bd709d81790b20b9c1683b3d8a233cc6caea Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Wed, 7 Aug 2024 11:23:07 -0400 Subject: [PATCH] Added GDScript stuff for connecting neovim to godot as my external editor. --- ftplugin/gdscript.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ftplugin/gdscript.lua diff --git a/ftplugin/gdscript.lua b/ftplugin/gdscript.lua new file mode 100644 index 0000000..c573a38 --- /dev/null +++ b/ftplugin/gdscript.lua @@ -0,0 +1,14 @@ +local port = os.getenv('GDScript_Port') or '6005' +local cmd = vim.lsp.rpc.connect('127.0.0.1', port) +local pipe = '/tmp/godot.pipe' + +vim.print("Hello, World from gdscript") + +vim.lsp.start({ + name = 'Godot', + cmd = cmd, + root_dir = vim.fs.dirname(vim.fs.find({ 'project.godot', '.git' }, { upaward = true })[1]), + on_attach = function(client, bufnr) + vim.api.nvim_command('echo serverstart("' .. pipe .. '")') + end +})