How do I apply an ex-command on a set of visually selected lines?
register is set to the start of the visual region and the > register is set to the end of the visual region. You can use these registers to specify the range for an ex command. After visually selecting the lines, press “:” to go to the command mode. Vim will automatically insert the visual range ‘<,'>. You can run any ex-command on the visual range. For more information, read :help v_: :help ‘< :help '> 15.4.