简体   繁体   English

GVIM:如何在Windows下通过文件传递多个参数

[英]GVIM: How to pass in multiple arguments via a file under windows

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? 是否有人知道命令行选项或将文件传递到gvim的方法,它将使用该文件的内容作为参数列表?

Achieving this without having to populate argv with a list of files. 无需在argv中填充文件列表即可实现此目的。

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. 问题是vim是一个unix工具,默认情况下它假定将通过管道传输文件列表,如果有1000个文件需要打开,但是在Windows世界中,可以输入多少个参数是有限制的在命令行上。 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. 在Windows命令行上执行此操作的方法是拥有一个文件,其中包含您希望传递给程序的所有参数。 I am wondering if gvim provides such an option. 我想知道gvim是否提供这样的选项。

Note: This is to invoke gvim in a windows compatible way ie avoid using extremely long argument lists 注意:这是以Windows兼容的方式调用gvim,即避免使用过长的参数列表

A simple solution: 一个简单的解决方案:

  1. list your files in files , 在文件中列出您的files

     file1 file2 file3 
  2. open Vim with the command below, 使用以下命令打开Vim,

     $ vim -c next `cat files` 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM