Re: Feed a list of filenames to vim

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



On 5/18/2011 12:50 AM, Jussi Hirvi wrote:
> On 17.5.2011 19.36, Bowie Bailey wrote:
>> Try this:
>>
>> vim `cat list`
> Thanks, this really works! I tried it with all my combinations:
>
> OS X workstation by itself
> OS X workstation -> ssh -> CentOS 4
> OS X workstation -> ssh -> CentOS 5
>
> BTW, with the xargs command, all of these combinations give some 
> problems. The cause may have something to do with my terminal settings. 
> Anyway, now I can use `cat list`.

The problem is that you were screwing up vim's stdin.  Using the method
I gave you, you are just taking advantage of shell features to provide a
list of filenames to vim on the command line.

If your list looks like this:

file1
file2
file3

Then when you do "vim `cat list`", the shell expands it to this:

$ vim file1 file2 file3

You can also do this:

$ vim `ls -1 *.txt`

or this:

$ vim `find /some/dir -name '*.txt'`

It works with any command that outputs a list of filenames.

-- 
Bowie
_______________________________________________
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