In situ manipulation of van der Waals heterostructures for twistronics