How to paste text to end of every line? Sublime 2

Tony H. picture Tony H. · May 22, 2012 · Viewed 136.1k times · Source

I'm curious if there is a way to paste text to the end of every line in Sublime 2? And conversely, to the beginning of every line.

test line one

test line two

test line three

test line four

...

Say you have 100 lines of text in the editor, and you want to paste quotation marks to the beginning and end of each line.

Is there an easy way to do this or a plugin that anyone would know of? This would often save me a lot of time on various projects.

Thanks.

Answer

palaniraja picture palaniraja · Jul 20, 2012

Yeah Regex is cool, but there are other alternative.

  • Select all the lines you want to prefix or suffix
  • Goto menu Selection -> Split into Lines (Cmd/Ctrl + Shift + L)

This allows you to edit multiple lines at once. Now you can add *Quotes (") or anything * at start and end of each lines.