Skip to content

JohnAugustsson/NvimSourceCodeAccess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NvimSourceCodeAccess

A lightweight Unreal Engine source code accessor plugin that lets the Unreal Editor open C++ files in Neovim on Linux and Windows.

It is intended as a simple replacement for the built-in editor integrations when you want Unreal's "Open C++ Class" and related actions to target Neovim instead of CLion, VS Code, Rider, etc.

What it does

Adds Nvim as an alterative under source code editors in unreal.

When Unreal asks to open a source file, the plugin does this:

  1. Looks for nvim and optional nvr on PATH.

  2. If nvr exists, it tries to open the requested file in an existing Neovim server:

    • Linux: /tmp/nvim-ue
    • Windows: \\.\pipe\nvim-ue
  3. If nvr is missing or cannot connect, it launches a new Neovim session. When nvr is available, that session is started with the fixed server name for future reuse:

    • Linux: a terminal running nvim --listen /tmp/nvim-ue <file>
    • Windows: cmd.exe /C start "" nvim.exe --listen \\.\pipe\nvim-ue <file>

    Without nvr, the plugin launches plain nvim <file>.

This gives you:

  • reuse of an already-running Neovim session
  • automatic startup of Neovim if none is already running
  • support for Unreal Editor actions like opening a C++ class from inside the editor

Platform

Currently intended for:

  • Linux
  • Windows / Win64
  • Unreal Engine 5.7

Dependencies

Required

  • Linux: nvim available on PATH
  • Windows: nvim.exe available on PATH

Recommended

  • Linux: nvr available on PATH
  • Windows: nvr.exe available on PATH

nvr is what allows the plugin to reuse an already-running Neovim session. Without it, the plugin can still launch a fresh Neovim instance, but it will not reopen files inside the existing session.

Executable overrides

If Unreal is launched from an environment that does not inherit your shell PATH, set these environment variables before starting the editor:

  • NVIM_SOURCE_CODE_ACCESS_NVIM: full path to nvim or nvim.exe
  • NVIM_SOURCE_CODE_ACCESS_NVR: full path to nvr or nvr.exe

Terminal fallback

The plugin will try these terminals, in this order, when it needs to start a fresh Neovim instance:

  • kitty
  • foot
  • wezterm
  • alacritty
  • gnome-terminal
  • konsole
  • xterm

At least one of those should exist on Linux. Windows starts Neovim through cmd.exe /C start.

How it works

The plugin registers a custom Unreal Source Code Accessor named:

  • Nvim

Inside Unreal Editor, you can select it as your source code editor in:

Edit -> Editor Preferences -> Source Code -> Source Code Editor

Once selected, Unreal will use this plugin when opening source files from the editor UI.

Server behavior

The plugin uses a fixed Neovim server name:

  • Linux: /tmp/nvim-ue
  • Windows: \\.\pipe\nvim-ue

That means:

  • when nvr is installed, the first file opened from Unreal starts Neovim with --listen <server-name>
  • later file opens reuse that session through nvr --servername <server-name>

If you close that Neovim instance, the next file opened from Unreal will start a new one.

Notes

  • This plugin is not project-path specific.
  • It does not hardcode a username, home directory, Unreal project path, or engine path.
  • The only hardcoded runtime value is the Neovim server name.

Limitations

  • Reuse of an existing Neovim session depends on nvr.
  • The plugin assumes nvim and Linux terminal executables are discoverable through PATH, unless overridden with environment variables.
  • The terminal fallback order is static.
  • The Neovim server name is currently hardcoded instead of configurable.

Windows validation

On a Windows host with Unreal Engine 5.7 and Visual Studio 2022 build tools installed, package the plugin with:

Engine\Build\BatchFiles\RunUAT.bat BuildPlugin -Plugin=C:\path\to\NvimSourceCodeAccess.uplugin -Package=C:\Temp\NvimSourceCodeAccessBuild -TargetPlatforms=Win64 -NoSubmit

Installation layout

Typical project plugin layout:

Plugins/NvimSourceCodeAccess/
├── NvimSourceCodeAccess.uplugin
└── Source/
    └── NvimSourceCodeAccess/
        ├── NvimSourceCodeAccess.Build.cs
        ├── Public/
        │   └── NvimSourceCodeAccessor.h
        └── Private/
            ├── NvimSourceCodeAccessor.cpp
            └── NvimSourceCodeAccessModule.cpp

About

nvim as source code editor for Unreal

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors