Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Nov 19 '12 at 9:18

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

2 Answers 2

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
1  
So, by inference, you could add two blank lines by removing the 'foo' and 'bar'? –  Jonathan Leffler Nov 19 '12 at 6:31
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.