How to insert text at beginning of a multi-line selection in vi/Vim

  • Press Esc to enter ‘command mode’
  • Use Ctrl+V to enter visual block mode
  • Move Up/Downto select the columns of text in the lines you want to
    comment.
  • Then hit Shift+i and type the text you want to insert.
  • Then hit Esc, wait 1 second and the inserted text will appear on every line.

For further information and reading, check out “Inserting text in multiple lines” in the Vim Tips Wiki.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)