| 1 | @echo off |
| 2 | @rem |
| 3 | @rem To use this with Visual Studio .Net |
| 4 | @rem Tools->External Tools... |
| 5 | @rem Add |
| 6 | @rem Title - Vim |
| 7 | @rem Command - c:\path\to\vim_vs_net.cmd |
| 8 | @rem Arguments - $(CurLine) $(ItemPath) |
| 9 | @rem Init Dir - Empty |
| 10 | @rem |
| 11 | @rem Coutesy of Brian Sturk |
| 12 | @rem |
| 13 | @rem --remote-tab-silent +%1 is a command +954, move ahead 954 lines |
| 14 | @rem --remote-tab-silent %2 full path to file |
| 15 | @rem In Vim |
| 16 | @rem :h --remote-tab-silent for mor details |
| 17 | @rem |
| 18 | @rem --servername VS_NET |
| 19 | @rem This will create a new instance of vim called VS_NET. So if you |
| 20 | @rem open |
| 21 | @rem multiple files from VS, they will use the same instance of Vim. |
| 22 | @rem This allows you to have multiple copies of Vim running, but you can |
| 23 | @rem control which one has VS files in it. |
| 24 | @rem |
| 25 | |
| 26 | IF "%~2" == "" (GOTO WITHOUT_LINE_NO) else GOTO WITH_LINE_NO |
| 27 | |
| 28 | :WITH_LINE_NO |
| 29 | start /b gvim.exe --servername VS_NET --remote-tab-silent +%1 %2 |
| 30 | GOTO END |
| 31 | |
| 32 | :WITHOUT_LINE_NO |
| 33 | start /b gvim.exe --servername VS_NET --remote-tab-silent %1 |
| 34 | GOTO END |
| 35 | |
| 36 | :END |
| 37 | |
| 38 | |