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.

If it were linux, I'd do it like this:

echo "w DST_FILE | q" | vim -Esu NONE -r SWP_FILE

I'm trying to do the same under windows with git's bash, but with no result. It hangs and doesn't create recovered file. This way it almost works:

vim -u NONE -r SWP_FILE

But I need to manually save the resulting file. The same happens when I run it from cmd with the same command:

echo "w DST_FILE | q" | vim -Esu NONE -r SWP_FILE
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Why don't you pass the Vim commands with -c?!

$ vim -u NONE -r SWP_FILE -c 'w DST_FILE' -c q
share|improve this answer
    
Good question, as far as I remember, I pass commands to stdin because of the example in documentation. –  x-yuri Jun 14 '13 at 14:02
add comment

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.