GVIM:如何在windows下通过文件传递多个参数 [英] GVIM: How to pass in multiple arguments via a file under windows

查看:23
本文介绍了GVIM:如何在windows下通过文件传递多个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道命令行选项或将文件传递给 gvim 的方法,该文件将使用该文件的内容作为参数列表?

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?

无需使用文件列表填充 argv 即可实现此目的.

Achieving this without having to populate argv with a list of files.

问题是 vim 是一个 unix 工具,默认情况下,如果有 1000 个文件需要打开,它会假定文件列表将被输入,但是在 windows 世界中,有多少个文件是有限制的您可以在命令行上使用的参数.在 Windows 命令行上执行此操作的方法是拥有一个包含您希望传递给程序的所有参数的文件.我想知道 gvim 是否提供了这样的选项.

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.

注意:这是为了以 Windows 兼容的方式调用 gvim,即避免使用过长的参数列表

Note: This is to invoke gvim in a windows compatible way i.e. avoid using extremely long argument lists

推荐答案

一个简单的解决方案:

  1. files

file1
file2
file3

  • 使用以下命令打开 Vim,

  • open Vim with the command below,

    $ vim -c next `cat files`
    

  • 这篇关于GVIM:如何在windows下通过文件传递多个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆