Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Seeking help in vi editor.

I want to insert in the begin of line. I wanted it to be insserted for specific line ranges. for eg, line number 1 to line number 20.

Any idea

share|improve this question
up vote 1 down vote accepted

Try this:

:1,20s/^/#/

where 1 and 20 compose the line number range, and the # is the text to be inserted at the beginning of the line.

That's the simplest way to do it, but there's a whole thread on other things to try at http://stackoverflow.com/questions/253380/how-do-i-insert-text-at-beginning-of-a-multi-line-selection-in-vi-vim

share|improve this answer
    
Thanks bobmagoo, I also just now got this link. Thanks for your help. – maneeshshetty Aug 27 '12 at 11:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .