On 2009-05-28, Erik Wognsen wrote:
> Hi..
>
> Why can't i pipe to xargs vim? I mean.. I can, but something is not right.
>
> After doing,
>
> $ ls somefile | xargs vim
>
> and exiting, the terminal is fubar and has to be reset.
>
> And this does the same:
> $ ls somefile | sed 's/^/vim /' | bash
>
> What's the problem?
When I do that, I see this message briefly at the top of the screen:
Vim: Warning: Input is not from a terminal
The problem is that xargs runs its argument commands in an
environment in which standard input is not the user's terminal.
Here's one way around that:
ls somefile | xargs sh -c '</dev/tty vim $*'
What I usually do, though, in situations like that is to run vim
like this:
vim $(ls somefile)
That assumes, of course, that the number of files doesn't exceed
MAX_ARGS or whatever that limit is called.
Regards,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---