How to pass search result to vim argadd command

Earlier, I learned and published about how to load multiple buffers using :argaddinstead :badd. However, I would like to add all the files of all subdirectories matching a specific template. My current attempt looks like this:

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

But it 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 should I do to make this work?

+5
source share
2 answers

But why don't you do it with

:args **/*.js 

(Yes, I know that you cannot filter files this way ...)

NTN

+4
source

"`", find args. , "!" , ...

:arga `find . -name '*glob_pattern*'`
0

All Articles