Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass the result of find to vim's argadd command

Tags:

file

find

vim

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?

like image 978
puk Avatar asked Jan 06 '12 09:01

puk


1 Answers

But why don't you do it with

:args **/*.js 

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

HTH

like image 185
Zsolt Botykai Avatar answered Oct 14 '22 07:10

Zsolt Botykai