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

I am using vim from mutt to reply to my emails and in the .muttrc I have the follow specified:

set editor= 'vim +1 -c "set textwidth=72" -c "set wrap" -c "set nocp" -c "set spell"'

I want to be able to add 2 new lines on top of the reply buffer so that I don't have to add them to every new reply.

So how do I prepend a new buffer from the launch options/commands?

Also, any other vim editor commands are welcome that would be useful in this situation : )

share|improve this question

migrated from Nov 19 '12 at 9:18

This question came from our site for professional and enthusiast programmers.

It would probably be better to set up a skeleton file (:help skeleton), but you can do:

 vim -c 'call append(0, ["foo", "bar"])'

to insert the two lines "foo" and "bar" at the first two lines of the new buffer.

share|improve this answer
So, by inference, you could add two blank lines by removing the 'foo' and 'bar'? – Jonathan Leffler Nov 19 '12 at 6:31
If merely adding blank lines, I would prefer romainl's suggestion: vim -c 'normal 2O' +3 – William Pursell Nov 19 '12 at 18:13
vim -c "set textwidth=72" -c "set wrap" -c "set nocp" -c "set spell" -c "normal 2O" +3

should work. That's a Capital O, not a zero, by the way.

share|improve this answer

You must log in to answer this question.

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