Guide on how to use Vim or Emacs with UE5 on Linux

I recently did a litte write-up on how to get UE5 to work with Vim or Emacs (or any other not officially supported editor/IDE), including code completion and syntax checking via LSP. I hope this is useful to someone here.

If anyone has any suggestions for some improvements, I’m all ears.

8 Likes

Hello, i use neovim on arch and article don’t help me
Clangd didn’t index any file with compile_commands from “ue gen” on version 5.2 - 5.4.1

I solved that problem by using command below:

Let’s assume that unreal engine is installed on path - /opt/unreal-engine

Then by using command

/opt/unreal-engine/Engine/Build/BatchFiles/Linux/Build.sh -mode=GenerateClangDatabase -project={PATH_TO_YOUR_UPROJECT_FILE} -game -engine {YourProject}Editor Linux Development

You can get compile_commands at path /opt/unreal-engine/compile_commands.json

This compile_commands works out of the box, there is no need to add flags c++20 and others (in my case).

For newbies: clangd tries to find compile_commands.json going from your project directory to root, if compile_commands will be in /opt/unreal-engine/compile_commands.json, clangd won’t find it.

You need to directly specify dirs where clangd will find compile_commands or make a symbolic link from your project dir → /opt/unreal-engine/compile_commands.json (in my case)

UPD:
ue build generates same compile_commands as command:
/opt/unreal-engine/Engine/Build/BatchFiles/Linux/Build.sh ...

1 Like