Neovim plugin that syncs the active buffer to the Unity Editor Project window.
Requires Rival/com.walcht.ide.neovim — a fork of com.walcht.ide.neovim that adds multi-instance port support. Hopefully this will be merged into the upstream repo soon.
| Command | Description |
|---|---|
:UnityPing [file] |
Flash-highlight the current (or given) file in Unity's Project window |
:UnitySelect [file] |
Select the file in Unity (appears in Inspector, highlighted in Project window) |
:UnityFollowToggle |
Toggle auto-select on BufEnter (off by default) |
Both :UnityPing and :UnitySelect accept an optional file path; defaults to the current buffer.
When Follow Active is enabled, switching buffers in nvim automatically selects the corresponding
asset in Unity's Project window — the same effect as :UnitySelect, but triggered on every
BufEnter for files matching the configured patterns (*.cs, *.shader, etc.).
This keeps Unity's Project window in sync with whatever file you are editing, so you never have to manually navigate to an asset to inspect it, ping it, or drag it into a scene.
Toggle it at runtime with :UnityFollowToggle, or enable it permanently in your config:
opts = {
follow_active = true,
debounce_ms = 300, -- delay before firing, to avoid flickering when cycling buffers quickly
}The debounce timer is reset on each BufEnter, so rapid buffer switches (e.g. scrolling
through the buffer list) only trigger one select on the file you actually land on.
{
dir = "path/to/unity-ping.nvim", -- or use the GitHub URL once published
ft = { "cs", "shader", "cginc", "hlsl" },
opts = {
port = 54321, -- fallback port if Library/.unity-ping-port is not found
debounce_ms = 300, -- debounce for follow-active mode
follow_active = false, -- set true to auto-select on BufEnter
},
}require("unity-ping").setup({
follow_active = false,
})Unity runs a small HTTP server (NeovimAssetPingServer) and writes its actual port to
Library/.unity-ping-port inside the project root. This allows multiple Unity editors
to run simultaneously on different ports without conflicts.
When sending a ping, the plugin walks up from the current buffer's path to find the Unity
project root (the directory containing Assets/), reads the port from Library/.unity-ping-port,
and sends a POST to /ping-asset or /select-asset with the absolute file path.
Unity resolves the path to an asset via AssetDatabase and calls PingObject / sets
Selection.activeObject on the main thread. Falls back to config.port if the port file
is not found.
- Neovim 0.10+
curlavailable in$PATH- Unity project open with
com.walcht.ide.neovimpackage installed