No edit summary |
(Change to TipImported template + severe manual clean) |
||
Line 1: | Line 1: | ||
{{review}} |
{{review}} |
||
+ | {{TipImported |
||
− | {{Tip |
||
|id=557 |
|id=557 |
||
+ | |previous=556 |
||
− | |title=Opening several files in vim via ListFile |
||
+ | |next=558 |
||
− | |created=September 16, 2003 |
+ | |created=September 16, 2003 |
|complexity=intermediate |
|complexity=intermediate |
||
|author=Alex J. |
|author=Alex J. |
||
|version=5.7 |
|version=5.7 |
||
|rating=3/4 |
|rating=3/4 |
||
⚫ | |||
− | |text= |
||
− | Suppose |
+ | Suppose you want to open several files in Vim, but the names of the files to open are stored in a file, each file name on separate line. This is the case with Total Commander, when you open a program and pass %L as a parameter. |
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | <pre> |
||
⚫ | |||
⚫ | |||
− | |||
+ | </pre> |
||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
Then I can select several files, press CTRL+ALT+F4 and load all of them into my favourite text editor :) |
Then I can select several files, press CTRL+ALT+F4 and load all of them into my favourite text editor :) |
||
⚫ | |||
− | == |
+ | ==Comments== |
+ | Try: |
||
− | try: |
||
− | gvim -c ":args `type mylist`" |
+ | gvim -c ":args `type mylist`" |
+ | You can also use commands like the following, even on Windows: |
||
⚫ | |||
⚫ | |||
− | work too, even with my w2k. |
||
− | '''Anonymous''' |
||
− | , September 26, 2003 10:15 |
||
---- |
---- |
||
− | <!-- parsed by vimtips.py in 0.470367 seconds--> |
Revision as of 07:26, 4 November 2007
created September 16, 2003 · complexity intermediate · author Alex J. · version 5.7
Suppose you want to open several files in Vim, but the names of the files to open are stored in a file, each file name on separate line. This is the case with Total Commander, when you open a program and pass %L as a parameter.
It is possible to do it like this:
gvim "+gl/^/exec 'badd '.getline('.')" +bdel +nohls +"cd %:h" LISTFILE
where LISTFILE contains the list of file names to open.
Using Total Commander, I create new item in "start menu", and assign a shortcut, let's say CTRL+ALT+F4 to it. Set path\gvim.exe as a command.
This is what i put in a "parameters" section:
"+gl/^/exec 'badd '.getline('.')" +bdel +nohls +"cd %%:h" %L
Then I can select several files, press CTRL+ALT+F4 and load all of them into my favourite text editor :)
Comments
Try:
gvim -c ":args `type mylist`"
You can also use commands like the following, even on Windows:
gvim *\2*\xx.txt