1 2 3 4 5 6
if filereadable("Cargo.toml") compiler cargo setlocal makeprg=cargo\ build else setlocal makeprg=rustc\ % endif