marcus-g
10/3/2017 - 8:19 PM

Vim: Insert Text Into Selection

This replaces the beginning of each selected line (use visual mode to select) with "//":

:'<,'>s!^!//!

From: https://stackoverflow.com/questions/253380/how-do-i-insert-text-at-beginning-of-a-multi-line-selection-in-vi-vim

" This replaces the beginning of each selected line (use visual mode to select) with "//":

:'<,'>s!^!//!