return { "weirongxu/plantuml-previewer.vim", dependencies = { "tyru/open-browser.vim", }, cmd = { "PlantumlOpen", "PlantumlStart", "PlantumlStop", "PlantumlSave", }, ft = "plantuml", init = function() -- Prefer the system PlantUML (if any) over the one bundled with the plugin. local cmdline = [[which plantuml | xargs cat | grep plantuml.jar]] local regex = [[\v\s['"]?(\S+/plantuml\.jar)]] local jar = vim.fn.matchlist(vim.fn.system(cmdline), regex)[2] if jar and vim.loop.fs_stat(jar) then vim.g["plantuml_previewer#plantuml_jar_path"] = jar end end, }