1

I want to open a set of files in a single vim window. This works:

$list = gci *.py -recurse
& gvim.exe $list

But this does not (it just gives me an empty vim window):

gci *.py -recurse | gvim.exe

How can this be done in a single line? It would also be helpful to know why my second method didn't work.

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
Jim K
  • 12,824
  • 2
  • 22
  • 51
  • I don't know the powershell syntax, with shell, you can do something like `vim $(gci *.py -recurse)`. – Kent Aug 15 '15 at 23:00

1 Answers1

2

Run Get-ChildItem in an expression:

& gvim.exe (gci *.py -Recurse)

Your second statement probably doesn't do anything, because gvim.exe doesn't seem to read filenames from STDIN (related).

Community
  • 1
  • 1
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
  • Well, I did a search before asking the question but didn't see the link you posted. Thanks for the answer! – Jim K Aug 16 '15 at 00:32