dotnet.vim 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. " Vim compiler file
  2. " Compiler: dotnet build (.NET CLI)
  3. " Maintainer: Nick Jensen <nickspoon@gmail.com>
  4. " Last Change: 2022-12-06
  5. " License: Vim (see :h license)
  6. " Repository: https://github.com/nickspoons/vim-cs
  7. if exists("current_compiler")
  8. finish
  9. endif
  10. let current_compiler = "dotnet"
  11. if exists(":CompilerSet") != 2 " older Vim always used :setlocal
  12. command -nargs=* CompilerSet setlocal <args>
  13. endif
  14. let s:cpo_save = &cpo
  15. set cpo&vim
  16. if get(g:, "dotnet_errors_only", v:false)
  17. CompilerSet makeprg=dotnet\ build\ -nologo
  18. \\ -consoleloggerparameters:NoSummary
  19. \\ -consoleloggerparameters:ErrorsOnly
  20. else
  21. CompilerSet makeprg=dotnet\ build\ -nologo\ -consoleloggerparameters:NoSummary
  22. endif
  23. if get(g:, "dotnet_show_project_file", v:true)
  24. CompilerSet errorformat=%E%f(%l\\,%c):\ %trror\ %m,
  25. \%W%f(%l\\,%c):\ %tarning\ %m,
  26. \%-G%.%#
  27. else
  28. CompilerSet errorformat=%E%f(%l\\,%c):\ %trror\ %m\ [%.%#],
  29. \%W%f(%l\\,%c):\ %tarning\ %m\ [%.%#],
  30. \%-G%.%#
  31. endif
  32. let &cpo = s:cpo_save
  33. unlet s:cpo_save