We describe the current status and recent results from (1) our ongoing programmes at various telescopes, including the VLT and NOT, aimed at performing target-of-opportunity follow-up spectroscopy of gamma-ray burst (GRB) afterglows; (2) our Swift/VLT legacy survey, a VLT Large Programme aimed at characterizing the host galaxies of a homogeneously selected sub-sample of Swift GRBs. The primary goal of (1) is to secure redshifts for a complete sample of GRBs: The redshift completion is now 52% with z̄ = 2.26. However, the observed GRB redshift distribution is still too uncertain to infer conclusively about the mapping from star-formation rate to GRB rate. The immediate goals of (2) is to determine the host luminosity function, study the effects of reddening, determine the fraction of Lyα emitters in the hosts, and obtain redshifts for targets with no absorption redshift. The main effort so far has been the definition of a very carefully selected sample, obeying strict and well-defined selection criteria: 71 targets in total. Among the preliminary results is a large optical detection rate, the lack of extremely red objects (only one possible case in the sample) and an update of the GRB redshift distribution with z̄ ∼2.0.