On 14/12/08 08:49, bgold12 wrote: > Hey, > > I've just discovered this amazing thing where I can call vim from the > Windows Command Prompt and execute a command directly with the -c > flag, which makes a certain C program I'm trying to write easier. But > I've also discovered that when I do this from the command prompt > myself (i.e. not from a program), and when I pipe input from the > cygwin ls command to vim, I get a strange error message, and then vim > freezes. For example, I'll type the following in Command Prompt and > press enter: > > ls |vim -c "normal ia" > > Then I get this error message that says "Vim: Warning: Input is not > from a terminal", and then vim seems to start up successfully with a > new (empty) file that has the "a" as the only contents. Then vim runs > full-out, hogging all my CPU, and I can't do anything, so I have to > close the shell completely. > > I actually don't really need to do this (pipe ls to vim); I was just > experimenting, but I would like to know what's going on here. Seems > like an error of some kind. > > Thanks.
To edit the file on stdin (the output of ls) add a dash at the end of the Vim command-line. See :help -- Normally, Console Vim expects stdin to be the keyboard and stdout to be the display. Here, you are reassigning stdin to something other than keyboard commands to Vim, so you need to tell it about the change. Best regards, Tony. -- Please take note: --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
