From e1893bc5b7220ed2fe787fce518cefe46b562be0 Mon Sep 17 00:00:00 2001 From: mathijs-bakker Date: Fri, 22 Aug 2025 14:47:36 +0200 Subject: [PATCH] Add :help doc --- doc/godotdev.txt | 135 +++++++++++++++++++++++++++++++++++++++++++++++ doc/tags | 9 ++++ 2 files changed, 144 insertions(+) create mode 100644 doc/godotdev.txt create mode 100644 doc/tags diff --git a/doc/godotdev.txt b/doc/godotdev.txt new file mode 100644 index 0000000..c26b8fc --- /dev/null +++ b/doc/godotdev.txt @@ -0,0 +1,135 @@ +godotdev.nvim *godotdev.txt* *godotdev* + +============================================================================== +Introduction *godotdev-intro* + +godotdev.nvim is a batteries-included Neovim plugin for Godot 4.3+ +game development using Neovim as an external editor. It provides: + +- LSP support for GDScript and .gdshader files +- Debugging via nvim-dap +- Treesitter syntax highlighting +- Keymaps for common LSP and DAP actions +- Optional C# support with dotnet, csharp-ls/OmniSharp, and netcoredbg + +See |godotdev-quickstart| for a quick start guide. + +============================================================================== +Quickstart *godotdev-quickstart* + +1. Open your Godot project in Neovim +2. Start Godot editor with TCP LSP enabled + (Editor Settings → Network → Enable TCP LSP server) +3. Open a .gd or .gdshader file +4. LSP will automatically attach +5. Use keymaps: + - gd → Go to definition + - gr → List references + - rn → Rename symbol + - See |godotdev-keymaps| for full list +6. Start debugging with DAP (Launch scene configuration) +7. Optional: Enable C# support by passing `csharp=true` to setup + +============================================================================== +Configuration *godotdev-configuration* + +Example setup: + + require("godotdev").setup({ + editor_host = "127.0.0.1", -- Godot editor host + editor_port = 6005, -- LSP port + debug_port = 6006, -- DAP port + csharp = true, -- enable C# support + }) + +Recommended Godot editor settings for external Neovim integration: + +- Editor Settings > Text Editor > Behavior > Auto Reload Scripts on External Change +- Editor Settings > Interface > Editor > Save on Focus Loss +- Editor Settings > Interface > Editor > Import Resources When Unfocused + +============================================================================== +External editor integration *godotdev-external* + +macOS/Linux: + +1. Create launch script (e.g., ~/.local/bin/open-nvim-godot.sh): + + #!/bin/bash + FILE="$1" LINE="$2" COL="$3" + /Applications/Ghostty.app/Contents/MacOS/ghostty -- nvim "$FILE" +"$LINE:$COL" + # Linux: gnome-terminal -- nvim "$FILE" +"$LINE:$COL" + +2. Make executable: + chmod +x ~/.local/bin/open-nvim-godot.sh + +3. Add to PATH: + echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc + +4. Configure Godot (Editor > Editor Settings > Text Editor > External): + - Full path: ~/.local/bin/open-nvim-godot.sh + - Parameters: {file} {line} {col} + +5. Start Neovim with: + nvim --listen /tmp/godot.pipe + Optionally add alias: + alias gdvim='nvim --listen /tmp/godot.pipe' + +Windows: + +1. Start Neovim listening on TCP: + nvim --listen 127.0.0.1:6666 +2. Configure Godot to connect to the same host:port. + +============================================================================== +Keymaps *godotdev-keymaps* + +LSP: +- gd → Go to definition +- gD → Go to declaration +- gy → Type definition +- gi → Go to implementation +- gr → List references +- K → Hover +- → Signature help +- rn → Rename symbol +- ca → Code action +- f → Format buffer +- gl → Show diagnostics +- [d / ]d → Previous/Next diagnostic + +DAP: +- F5 → Continue / Start +- F10 → Step over +- F11 → Step into +- F12 → Step out +- db → Toggle breakpoint +- dB → Conditional breakpoint +- du → Toggle UI +- dr → Open REPL + +============================================================================== +Health checks *godotdev-checkhealth* + +Use `:checkhealth godotdev` to verify: + +Dependencies: +- nvim-lspconfig +- nvim-treesitter +- nvim-dap +- nvim-dap-ui +- Windows users: ncat + +Godot editor: +- LSP server +- Debug server + +Optional C# support: +- dotnet SDK +- C# LSP server (csharp-ls or OmniSharp) +- netcoredbg debugger + +============================================================================== +License *godotdev-license* + +MIT diff --git a/doc/tags b/doc/tags new file mode 100644 index 0000000..4c108db --- /dev/null +++ b/doc/tags @@ -0,0 +1,9 @@ +godotdev godotdev.txt /*godotdev* +godotdev-checkhealth godotdev.txt /*godotdev-checkhealth* +godotdev-configuration godotdev.txt /*godotdev-configuration* +godotdev-external godotdev.txt /*godotdev-external* +godotdev-intro godotdev.txt /*godotdev-intro* +godotdev-keymaps godotdev.txt /*godotdev-keymaps* +godotdev-license godotdev.txt /*godotdev-license* +godotdev-quickstart godotdev.txt /*godotdev-quickstart* +godotdev.txt godotdev.txt /*godotdev.txt*