Based on this post
# Official repository
sudo pacman -S code dotnet-sdk mono mono-tools mono-msbuild mono-msbuild-sdkresolver mono-addins
# Aur repository
yay -Sy unityhub
...and yes you will need to install vscode, more on this later.
Don't be tempted to install omnisharp from aur repositories. I mean, they work wonders for dotnet core applications, but not for Unity projects which are based on Mono, because of this I recommend installing it manually in your system.
Go to Omnisharp's release page and download the latest version of omnisharp-linux-x86.zip
unzip omnisharp-linux-x86.zip -d ~/.omnisharp
chmod +x /home/delboni/.omnisharp/run
sudo ln -sf /home/delboni/.omnisharp/ /usr/local/lib/omnisharp
My setup is based on cajus-nvim so I did the following additions to the default files:
On line 61
add this function call (keep in mind the path you installed omnisharp will vary)
(lsp.omnisharp.setup {:on_attach on_attach
:handlers handlers
:capabilities capabilities
:cmd ["/usr/local/lib/omnisharp/run"]})
On line 6
add :c_sharp
anywhere between the square brackets.
On Unity side you will need to install the vscode editor plugin.
Open Unity Editor -> Window -> Package Manager -> Search for Visual Studio Code Editor -> Install
Then you need to select your Script Editor as vscode and for this option be shown you need it installed (Note: Currently this is the only way the editor offers you the options to generate .csproj files)
Unity Editor -> Edit -> Preferences -> External Tools -> External Tools Editor -> Visual Studio Code Insiders
In the new area "Generate .csproj files for" thick all the check boxes and Click "Regenerate project files" button
Open your nvim from the root of any Unity project (usually where the .sln will be) and navigate to an script file.
Way a little bit to omnisharp parse your files and then do a :LspInfo
something similar to the next printscreen should be shown
Now you can use basic LSP commands like Documentation
, Local Go To Definition
and Auto Complete
The Ultimate, multiplatform solution, Use Neovim as Code Editor for unity nvim-unity , sync the project files automaticaly: nvim-unity-sync, Great workflow!