在 Visual Studio 2005 里,选择菜单 Tools->External Tools...
加入
Title: Vim
Command: C:\Program Files\Vim\vim72\gvim.exe
Arguments: --servername VS_2005 --remote-silent "+call cursor($(CurLine), $(CurCol))" $(ItemPath) Init Dir - 空
现在在 Visual Studio 2005 里打开文件时,可以在工具 菜单里选择: Vim
这样就能在 Vim 里打开文件。
可以把该外部命令作为图标加入,把它放在任何你喜欢的位置上。也可以把它设为你的缺省编辑器。
---------------------------------------------
解释:
--servername VS_NET
建立 vim 的新实例,名为 VS_NET。这样如果你从 VS 里打开多个文件,它们会使用相同
的 Vim 实例。这样,你可以运行多个 Vim 的备份,但可以控制在哪个里编辑 VS 文件。
--remote-silent "+call cursor(10, 27)"
- 把光标放在第 10 行第 27 列
Vim 里 >
:h --remote-silent 可以了解详情