# Neovim as Source Code Editor

**URL:** <https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742>\
**Category:** Plugins\
**Tags:** unreal-engine, UE5-0, Plugins\
**Created:** [September 10, 2022, 12:57pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742 "2022-09-10T12:57:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![SrMrBurchick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/srmrburchick/32/557034_2.png) [@SrMrBurchick](https://forums.unrealengine.com/u/SrMrBurchick)\
**Post date:** [September 10, 2022, 12:57pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/1 "2022-09-10T12:57:49Z")

</div>

Hello there I’ve created plugin for Unreal Engine 5. And it’s allows you to edit your code through the neovim. Here is short **[demo of work](https://youtu.be/PHurza1lJ0k)**. It’s just tested for Linux platform. Support for other platforms will be added soon. Here is **[pool request](https://github.com/EpicGames/UnrealEngine/pull/9556)**

---

<div class="post-metadata">

**Author:** ![zadirion](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zadirion](https://forums.unrealengine.com/u/zadirion)\
**Post date:** [October 29, 2023, 2:18pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/2 "2023-10-29T14:18:32Z")

</div>

Hello, I also have a plugin, but mine is for neovim. It’s a plugin+configuration, and gets syntax highlighting working for unreal engine, along with some familiar hotkeys

> **[GitHub - zadirion/UnrealHero.nvim: Nvim configuration suitable for...](https://github.com/zadirion/UnrealHero.nvim)**
>
> Nvim configuration suitable for development in Unreal Engine - GitHub - zadirion/UnrealHero.nvim: Nvim configuration suitable for development in Unreal Engine

---

<div class="post-metadata">

**Author:** ![star-3gg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@star-3gg](https://forums.unrealengine.com/u/star-3gg)\
**Post date:** [July 11, 2024, 9:50pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/3 "2024-07-11T21:50:55Z")

</div>

I absolutely love the idea, sorry to hear your PR was rejected. I think the reviewers don’t know what neovim is. don’t let it discourage you \<3

---

<div class="post-metadata">

**Author:** ![chuckie.meister](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chuckie.meister](https://forums.unrealengine.com/u/chuckie.meister)\
**Post date:** [August 7, 2024, 4:07am UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/4 "2024-08-07T04:07:25Z")

</div>

Man I’m trying very hard to integrate neovim on unreal engine, I put your changes manually and it fails. I’ll love to hear if you still use that code for your own plugin configuration.

---

<div class="post-metadata">

**Author:** ![dzemzmcdonalda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dzemzmcdonalda/32/1214680_2.png) [@dzemzmcdonalda](https://forums.unrealengine.com/u/dzemzmcdonalda)\
**Post date:** [August 12, 2024, 7:11pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/5 "2024-08-12T19:11:31Z")

</div>

@chuckie.meister

The OP’s plugin is a SourceCodeAcessor, it only allows for opening files by clicking at them inside of Unreal Editor, but nothing else - it won’t provide code competition, LSP navigation or syntax highlight, it does NOT serve any other purpose than opening files. Do you actually need this functionality?

Also, you don’t need to apply those patches into Engine source tree. You can find a standalone plugin on OP’s github (link below), but have in mind that code is unlicensed and abandoned.

> **[GitHub - SrMrBurchick/NeovimSourceCodeAccess](https://github.com/SrMrBurchick/NeovimSourceCodeAccess)**
>
> Contribute to SrMrBurchick/NeovimSourceCodeAccess development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![SrMrBurchick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/srmrburchick/32/557034_2.png) [@SrMrBurchick](https://forums.unrealengine.com/u/SrMrBurchick)\
**Post date:** [August 27, 2024, 7:15am UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/6 "2024-08-27T07:15:50Z")

</div>

XD, one day. I’ll return for that plugin! XD Its not abandoned! 🙃

---

<div class="post-metadata">

**Author:** ![dzemzmcdonalda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dzemzmcdonalda/32/1214680_2.png) [@dzemzmcdonalda](https://forums.unrealengine.com/u/dzemzmcdonalda)\
**Post date:** [August 29, 2024, 10:10am UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/7 "2024-08-29T10:10:40Z")

</div>

> [@SrMrBurchick](#):
>
> Its not abandoned!

It has only one commit :v

---

<div class="post-metadata">

**Author:** ![chuckie.meister](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chuckie.meister](https://forums.unrealengine.com/u/chuckie.meister)\
**Post date:** [September 1, 2024, 8:09pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/8 "2024-09-01T20:09:30Z")

</div>

Thank you very much for your reply, in that case I don’t need it. Still trying to find a way to have autocompletion without any weird errors like the following:

 ![Screenshot from 2024-09-01 16-08-45](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/a/a/5aa669ce8dbf2a857959f9849769d84e76fcb823.png)

---

<div class="post-metadata">

**Author:** ![dzemzmcdonalda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dzemzmcdonalda/32/1214680_2.png) [@dzemzmcdonalda](https://forums.unrealengine.com/u/dzemzmcdonalda)\
**Post date:** [September 3, 2024, 11:20pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/9 "2024-09-03T23:20:41Z")

</div>

Do you have a proper `compile_commands.json` database? @chuckie.meister  
`clangd` needs it in order to diagnose your code correctly.  
You can check how it’s done here:

> [@Get compile\_commands.json](https://forums.unrealengine.com/t/get-compile-commands-json/433389/18):
>
> I can confirm this works on my side, although I also have some problems (mentioned down below). Here’s how I make it happen: Make sure your project is actually built with the build tool. Without it you’ll get warnings due to missing UHT-generated code. Generate compile\_commands.json with Build.sh. In my case my project is called Tlob, so I use TlobEditor module, Linux target (for Windows, it’s Win64), and DebugGame configuration (default would be Development), but you gotta adjust those for y…

---

<div class="post-metadata">

**Author:** ![chuckie.meister](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chuckie.meister](https://forums.unrealengine.com/u/chuckie.meister)\
**Post date:** [September 7, 2024, 8:06pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/10 "2024-09-07T20:06:44Z")

</div>

I get the `compile_commands.json` file from the Build.sh:

```auto
ue(){
    project_folder=$(basename "$(pwd)")

    /bin/bash ~/Unreal_Engine/Engine/Build/BatchFiles/Linux/Build.sh \
        ~/Games/Unreal\ Projects/$project_folder/$project_folder.uproject \
        -game \
        -engine $project_folder\Editor Linux Development

    /bin/bash ~/Unreal_Engine/Engine/Build/BatchFiles/Linux/Build.sh \
        -mode=GenerateClangDatabase \
        -project=/home/chm/Games/Unreal\ Projects/$project_folder/$project_folder.uproject \
        -game \
        -engine $project_folder\Editor Linux Development

    mv ~/Unreal_Engine/compile_commands.json ~/Games/Unreal\ Projects/$project_folder/ 
}

```

but this only get my LSP auto-completion working, but it will throws too many errors on the editor. I put the `compile_commands.json` in my project root directory (where the `.uproject` file is place).

---

<div class="post-metadata">

**Author:** ![dzemzmcdonalda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dzemzmcdonalda/32/1214680_2.png) [@dzemzmcdonalda](https://forums.unrealengine.com/u/dzemzmcdonalda)\
**Post date:** [September 14, 2024, 1:44pm UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/11 "2024-09-14T13:44:35Z")

</div>

@chuckie.meister This is most likely what’s breaking it:

```auto
mv ~/Unreal_Engine/compile_commands.json ~/Games/Unreal\ Projects/$project_folder/

```

You need the same `compile_commands.json` in BOTH: your project’s root directory AND engine’s root directory.

In your case, you’re moving said file so it’s missing from the engine’s root directory.  
Instead of `mv` (move), try using either: `ln -sf` (symbolic link) OR `cp -f` (copy).

Also make sure to reset clangd and delete its indexing so it can be regenerated.

* * *

If you’re wondering why said file must be located in two places the answer is [here](https://clangd.llvm.org/design/compile-commands#compilation-databases):  
_“We [clangd] first check for a compilation database in the directory containing the source file, and then walk up into parent directories until we find one.”_

---

<div class="post-metadata">

**Author:** ![SaladinAyyub](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/saladinayyub/32/1103235_2.png) [@SaladinAyyub](https://forums.unrealengine.com/u/SaladinAyyub)\
**Post date:** [December 18, 2024, 3:22am UTC](https://forums.unrealengine.com/t/neovim-as-source-code-editor/645742/12 "2024-12-18T03:22:05Z")

</div>

Having an issue with this with NeovimSourceCodeAccess enabled that

 ![Screenshot From 2024-12-18 08-51-51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/c/d8cf0ebe9a7068b05c01d3ce968198f57d1a3b74.png)

Same error while generating clang database

I really wished generating project files for clangd was much simpler ☹ They just bound themselves for no reason with the C++ vscode extension by microsoft when clearly clangd is used everywhere including vscode.

Update: Fixed this by copy pasta the NeovimSourceCode Access in the project plugins.
