问题
Is anyone aware of a command line option or a way to pass in a file to gvim which will use the contents of that file as a list of arguments?
Achieving this without having to populate argv with a list of files.
The problem is that vim is a unix tool which by default assumes that a list of files would be piped in, if there are say 1000 files that need to be opened, however in the windows world there is a limit to how many arguments you can have on the command line. The way to do this on a windows command line is to have a file which contains all the arguments you wish to pass onto the program. I am wondering if gvim provides such an option.
Note: This is to invoke gvim in a windows compatible way i.e. avoid using extremely long argument lists
回答1:
A simple solution:
list your files in
files,file1 file2 file3open Vim with the command below,
$ vim -c next `cat files`
来源:https://stackoverflow.com/questions/32327919/gvim-how-to-pass-in-multiple-arguments-via-a-file-under-windows