Zed: LaTeX build-on-save with cleanup via texlab wrapper script
To have Zed build a .tex file's PDF on every save and then delete latexmk's auxiliary files (as an Emacs after-save-hook would), point the latex extension's texlab at a wrapper script: lsp.texlab.settings.texlab.build = { onSave: true, executable: "/path/latex-build", args: ["%f"], forwardSearchAfter: false }. The script cds into the file's folder, runs latexmk -pdf -interaction=nonstopmode, keeps its exit status, then runs latexmk -c (which keeps the pdf). Setting TEXINPUTS=".:<parent>:" in the script lets shared .sty files in the parent folder resolve. Omit -synctex unless you use forward search, or a .synctex.gz is left behind. Also note: Zed rewrites settings.json through a symlink when answering its own prompts (e.g. cli_default_open_behavior), which dotfile managers then report as drift.