Make vim understand files and formats from the Unity game engine.
compiler csprocesses Unity build output to recognize callstacks.unityengine#ale#setup_ale(path_to_unity_project)simplifies linting with ale.- ShaderLab files recognized as glsl. (See vim polyglot or vim glsl).
cs.vim enhances c# output to find unity errors. Use something like this to load them:
" Platform dependent. See https://docs.unity3d.com/Manual/LogFiles.html
let logfile = $LocalAppData .'/Unity/Editor/Editor.log'
" Project dependent.
let g:project_root = 'c:/blah/project'
if !isdirectory(g:project_root .'/Assets')
echoerr "project_root should be the root of your Unity project"
return
endif
let logfile = fnamemodify(logfile, ":p")
" Unity logs can be massive (GBs) when you have spam, so only take the last chunk.
exec '!tail --lines=5000 '. logfile .'> /tmp/shortened.log'
exec 'cd '. g:project_root
compiler cs
cgetfile /tmp/shortened.log
copen
- vim-unityengine-docs for searching Unity documentation.
- For completion of Unity code, see omnisharp-vim for C# from dlls (use
:OmniSharpInstallto ensure proper setup) or use ctags on UnityCsReference (pick the branch for your version of Unity).
Check out VimUnity3D to get building working: https://github.com/K-Tone/VimUnity3D/blob/master/vimcompile.py