How can I install a vanity over this unfortunate plumbing?
Cut that pipe out in 2 places. One place is above the bottom shelf of the new cabinet and mid way between the 2 fittings on the upper pipe that goes at a 45 degree angle. Recouple it back together when the cabinet is installed. The supply lines need to be relocated too, but you may be able to move them around to get past their issues.

The cutting of the vent pipe is still taking a small chance it will be difficult to get the pipe back together. As it is you will need to shorten the pipe you cut  out at least by a 1/2" to make room for the stop built in as part of the coupler. You will also need to account for how much out of square the cut has too.

If the upper portion of the pipe has a little upward give to it, it will be a lot easier to rejoin. If not you will need to be really assertive on getting it back together again.