7

I previously found out, and posted, about how to load multiple buffers using :argadd instead of :badd. However, I would further like to add all files of all subdirectories matching a certain pattern. My current attempt looks like so:

:argadd !find . -name *.js -type f

But that adds

 51      "!find"                        line 1
 52      "~/Documents/neuro-sim/website/3.0" line 1
 53      "-name"                        line 1
 54      "*.js"                         line 1
 55      "-type"                        line 1
 56      "f"                            line 1

to the buffer. What modification do I have to make to make this work?

Community
  • 1
  • 1
puk
  • 16,318
  • 29
  • 119
  • 199

2 Answers2

6

But why don't you do it with

:args **/*.js 

(Yeah, I know you can't filter for files this way...)

HTH

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110
0

You need backticks "`" to evaluate the find and plug them into args. I agree it does seem strange to not use "!" but I think that is for handling stream buffers not args...

:arga `find . -name '*glob_pattern*'`
rupert160
  • 1,441
  • 1
  • 17
  • 19