Re: Feed a list of filenames to vim

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



In article <4DD3E087.5060305@xxxxxxx>,
Bowie Bailey <Bowie_Bailey@xxxxxxx> wrote:
> On 5/18/2011 10:42 AM, Michael Gliwinski wrote:
> > How about just:
> >
> >   $ vim *.txt
> >
> > or, if you need recursive:
> >
> >   $ eval vim $(find /some/dir -type f -printf '"%p" ')
> >
> > (shell quotes expansions automatically, but you can still ensure output from 
> > find is appropriately quoted manually)
> 
> Interesting.  I'm not sure what the eval is doing, but it works even
> with spaces in the filenames.  Unfortunately, it won't work with the
> OP's original scenario (a file with a list of filenames to edit).

After a bit of experimentation, I found that this would work:

$ eval vim $(sed 's/.*/"&"/' file)

If this became a frequent requirement, perhaps an alias or function
could be created.

Cheers
Tony
-- 
Tony Mountifield
Work: tony@xxxxxxxxxxxxx - http://www.softins.co.uk
Play: tony@xxxxxxxxxxxxxxx - http://tony.mountifield.org
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux