0

I'm starting vim in Ex mode, silent mode, on Windows 10, in a standard command prompt window. I'm trying to re-direct stdin from a file. I'm using the terminal version of vim 8.2.2824. It doesn't work, the commands from the file aren't executed. When I kill it with CTRL-C, I get the errors shown.

C:\Users\paulc>vim -e -s <tempsource  
^CTerminate batch job (Y/N)? sleep 3  
Terminate batch job (Y/N)? sleep 2  
Terminate batch job (Y/N)? q  
Terminate batch job (Y/N)?  
  
C:\Users\paulc>  

tempsource has the three lines:

sleep 3  
sleep 2  
q  

I wait more than 10 seconds before killing it. It doesn't help if the commands are prefixed with : If someone knows how to get this to work I'd appreciate help.

6
  • I believe that is a different use of -s, which is equivalent to launching vim and running :source <filename>. In that case -e isn't used. When -s doesn't have an argument, it follows -e or -E, and it's silent mode. May 22 at 18:52
  • That is, click the ? and then 'code'.
    – B Layer
    May 22 at 19:02
  • 1
    Ok thanks I think I've got it formatted now May 22 at 20:22
  • Looks like DBK formatted it. Do yourself a favor and read that help section that I mentioned. (You can also look at what DBK did.)
    – B Layer
    May 23 at 9:43
  • If there are still any outstanding formatting issues, please let me know. May 23 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.