Skip to content

Instantly share code, notes, and snippets.

@gsuuon
Created October 24, 2024 05:52
Show Gist options
  • Save gsuuon/cbe4e24d556adcfc56a3f617db6730bd to your computer and use it in GitHub Desktop.
Save gsuuon/cbe4e24d556adcfc56a3f617db6730bd to your computer and use it in GitHub Desktop.
nvim godot lsp setup in `after/ftplugin/`
local port = os.getenv('GDScript_Port') or '6005'
local pipe = [[\\.\pipe\godot.pipe]]
vim.lsp.start({
name = 'Godot',
cmd = vim.lsp.rpc.connect('127.0.0.1', port),
root_dir = vim.fs.root(0, {'project.godot', '.git'}),
on_attach = function()
if not vim.tbl_contains(vim.fn.serverlist(), pipe) then
vim.fn.serverstart(pipe)
end
end
})
-- Can double click in Editor to go to file/line in neovim (after neovim has been opened and the LSP attached)
-- Editor settings > Text Editor > External > Exec Flags: --server "\\\\.\\pipe\\godot.pipe" --remote-send "<C-\\><C-N>:e {file}<CR>:call cursor({line}+1,{col})<CR>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment