Aims. We measure proper motions of fine structures in a forming sunspot to infer information about the dynamics of flux emergence at the sub-photospheric level. Methods. The active region NOAA 11024 was observed with the Vacuum Tower Telescope at Observatorio del Teide/Tenerife over several days in July 2009. Here, we concentrate on a two-hour sequence taken on July 4, when the leading spot was at an early stage of its evolution. Speckle reconstructions from Ca ii K images and polarimetric data in Fe i λ6173 allow us to study proper motions of umbral fine structures. Results. We detect three prominent features: (1) A light bridge, divided by a dark lane along its axis, shows proper motions in opposing directions on its sides, with velocities of ∼100-500 m s −1 . The flows are seen in both the Ca ii K and the broadband time sequences. (2) Umbral dots in one umbral region outline a vortex with speeds of up to 550 m s −1 . The direction of the motion of the umbral dots is different from that in the light bridge. (3) At one rim of the umbra, the fine structure of the magnetic field moves horizontally with typical velocities of 250-300 m s −1 , prior to the formation of the penumbra. Conclusions. We report on shear and vortex motions in a forming sunspot and interpret them as tracers of twist relaxation in magnetic flux ropes. We suggest that the forming sunspot contains detached magnetic flux ropes that emerge at the surface with different amounts of twist. As they merge to form a sunspot, they untwist giving rise to the observed shear and vortex motions.