8

I tried using Visual Studio instead of VIM(+plugins), but to be honest - the only advantage of VS over VIM is it's ability to automatically manage my project.

I know of existence of ViEmu for VS, but I would like to do the opposite - is there any way to manage projects from within VIM?

I tried both c.vim plugin and Project plugins, but:

  • I have a problem while using c.vim on windows (from what I remember, there is an error with "slashes" in filepath ).
  • Project allows to organize projects, but it lacks features for generating makefiles / msbuild files (or am I wrong?).

Are there any tips / solutions / hacks, which would allow me to use VIM to manage my projects? (ideally, using both makefiles and MSBuild files, but just one type of build files would be enough.)

zeroDivisible
  • 3,684
  • 7
  • 37
  • 61

5 Answers5

6

To integrate vim with devenv, you can use devenv from Visual Studio to complie the project in vim. The command as follows:

Devenv SolutionName /build SolnConfigName [/project ProjName [/projectconfig ProjConfigName]]

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.

AMing
  • 5,012
  • 2
  • 21
  • 14
2

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.

davetapley
  • 14,759
  • 11
  • 54
  • 74
1

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.

dimba
  • 24,103
  • 28
  • 127
  • 188
1

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.

flukus
  • 912
  • 8
  • 15
0

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? :)

lorry lee
  • 1
  • 2