My immediate thought was of the Eclim project which brings Eclipse functionality to Vim. Then you maybe able to manage your VS projects from Eclipse, I don't know any projects to do this, but I suspect some exist.
通常,devenv 应位于 C:\Program Files\Microsoft Visual Studio 8\Common7\IDE。 将其设置为环境路径以使其可从 vim 调用。 我们还需要让 vim 识别命令行构建工具 devenv 抛出的错误消息。 只需将以下行放入您的 vimrc 中:
" Quickfix mode: command line devenv error format
au FileType cpp set makeprg=devenv.com\ /Build\ Debug\ *[SolutionName]*
au FileType cpp set errorformat=\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %m
然后您可以使用 :make 从 vim 编译和构建程序。
To integrate vim with devenv, you can use devenv from Visual Studio to complie the project in vim. The command as follows:
Typicatlly, the devenv should located in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE. Set it to the path of environment to make it callable from vim. We also need to make vim recognize the error messages thrown by the commandline build tool devenv. Just put the following lines in your vimrc:
" Quickfix mode: command line devenv error format
au FileType cpp set makeprg=devenv.com\ /Build\ Debug\ *[SolutionName]*
au FileType cpp set errorformat=\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %m
Then You can use :make to compile and build the program from vim.
You don't have to maintain visual studio project files to manage your source code. There is a lot of pre generation tools to use to generate your visual studio project files. Such as CMake, Premake and more. This way you won't be driven crazy by the complicated VC projects settings, and it also bring the positibility to be cross-platform.
So in vim, you can split your project by physical folder, then use Cmake script to define the rule to generate projects.
When there is file added/removed, you re-generate your VC project, then call Cmake which will invoke msbuild to compile your projects.
You can use vim plugin YouCompleteMe for intelligence on compiler level.
You can write simple vim script to launch your compiled executable.
VS is full features IDE - you edit, compile and debug without leaving it.
vim in contrast is not IDE - its very powerful text editor. Yet vim has some build-in functionality oriented for programmers (e.g. :make command, compilation, automatic indentation etc.). vim is coming from Unix world where there several build tools (make, scons, cmake etc.). As you know you can "integrete" them using plugins which mostly very far from to be complete.
I think what you tried to do in the beginning is the right thing - bring vim editing power to VS world.
发布评论
评论(5)
我立即想到的是 Eclim 项目,它将 Eclipse 功能引入 Vim。 然后你也许可以从 Eclipse 管理你的 VS 项目,我不知道有什么项目可以做到这一点,但我怀疑有些项目存在。
My immediate thought was of the Eclim project which brings Eclipse functionality to Vim. Then you maybe able to manage your VS projects from Eclipse, I don't know any projects to do this, but I suspect some exist.
要将 vim 与 devenv 集成,您可以使用 Visual Studio 中的 devenv 在 vim 中编译项目。 命令如下:
通常,devenv 应位于 C:\Program Files\Microsoft Visual Studio 8\Common7\IDE。 将其设置为环境路径以使其可从 vim 调用。 我们还需要让 vim 识别命令行构建工具 devenv 抛出的错误消息。 只需将以下行放入您的 vimrc 中:
然后您可以使用 :make 从 vim 编译和构建程序。
To integrate vim with devenv, you can use devenv from Visual Studio to complie the project in vim. The command as follows:
Typicatlly, the devenv should located in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE. Set it to the path of environment to make it callable from vim. We also need to make vim recognize the error messages thrown by the commandline build tool devenv. Just put the following lines in your vimrc:
Then You can use :make to compile and build the program from vim.
您是否看过其他构建工具(nant 是 .net 中最流行的工具)?
Nant 比 msbuild 简单得多,您可以在几行内创建一个简单的构建文件,并轻松与 vims makeprg 集成。
Have you looked at other build tools (nant is the most popular for .net)?
Nant is far simpler than msbuild, you can create a simple build file in a few lines and easily integrate with vims makeprg.
您不必维护 Visual Studio 项目文件来管理源代码。 有很多预生成工具可用于生成 Visual Studio 项目文件。 比如CMake、Premake等等。 这样你就不会被复杂的VC项目设置逼疯了,而且还带来了跨平台的可能性。
因此,在vim中,您可以按物理文件夹拆分项目,然后使用Cmake脚本定义生成项目的规则。
当添加/删除文件时,您重新生成 VC 项目,然后调用 Cmake,它将调用 msbuild 来编译您的项目。
您可以使用 vim 插件 YouCompleteMe 获得编译器级别的智能。
您可以编写简单的 vim 脚本来启动编译后的可执行文件。
你还期待什么? :)
You don't have to maintain visual studio project files to manage your source code. There is a lot of pre generation tools to use to generate your visual studio project files. Such as CMake, Premake and more. This way you won't be driven crazy by the complicated VC projects settings, and it also bring the positibility to be cross-platform.
So in vim, you can split your project by physical folder, then use Cmake script to define the rule to generate projects.
When there is file added/removed, you re-generate your VC project, then call Cmake which will invoke msbuild to compile your projects.
You can use vim plugin YouCompleteMe for intelligence on compiler level.
You can write simple vim script to launch your compiled executable.
What else are you expecting for? :)
也许我不明白这个问题。
VS 是全功能 IDE - 您无需离开它即可进行编辑、编译和调试。
相比之下,vim 不是 IDE——它是非常强大的文本编辑器。 然而,vim 有一些面向程序员的内置功能(例如:make 命令、编译、自动缩进等)。 vim 来自 Unix 世界,那里有多种构建工具(make、scons、cmake 等)。 如您所知,您可以使用插件“集成”它们,但这些插件大多远未完成。
我认为你一开始尝试做的事情是正确的——将 vim 编辑能力带入 VS 世界。
Maybe I don't understand the question.
VS is full features IDE - you edit, compile and debug without leaving it.
vim in contrast is not IDE - its very powerful text editor. Yet vim has some build-in functionality oriented for programmers (e.g. :make command, compilation, automatic indentation etc.). vim is coming from Unix world where there several build tools (make, scons, cmake etc.). As you know you can "integrete" them using plugins which mostly very far from to be complete.
I think what you tried to do in the beginning is the right thing - bring vim editing power to VS world.