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

无人久伴 提交于 2020-01-17 06:32:28

问题


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:

  1. list your files in files,

    file1
    file2
    file3
    
  2. open 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!