Monday, September 9, 2013

Re: How to Use Vim with MSVC and msbuild? How the Developer Command Prompt Commands Can Be Use in Vim?


Hi Mark,

On Sat, Sep 7, 2013 at 8:58 PM, Mark Anthony Dungo <mail@servant.tk> wrote:
On Developer Command Prompt for VS2012 on (Microsoft) Windows, the commands "cl /EHsc filename.cpp" and "cl /clr basicclr.cpp" are used to compile a C++ program and a program that uses .NET classes. What can I do to make those commands compile a program in Vim?
I played around with :makeprg and :compiler for a few minutes to get Vim to use that command, but I couldn't get them to work.  I'm not really all that familiar with using :make and its friends in Vim though (see below).

The Developer Command Prompt sets some environment variables though.  You'll need to make sure that Vim has the same environment, especially that it has cl.exe in the path, or you provide the entire path to cl.exe.

 
I have VS Express for Desktop on this laptop, does it mean that I already have MSBuild? How can I set my system to allow me to compile with ":compiler msbuild" and ":comp msvc"?
 Note that MSBuild will run on your solution file, not your source files.  On my machine, msbuild.exe is installed at C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe. 
 
You may want to look into the VsVim plugin [1] for Visual Studio.  It makes Visual Studio aware of Vim-like keybindings, including normal and insert modes.  It lets you use the full features of Visual Studio along with the text-editing power of Vim keybindings.  It was enough for me that I didn't bother with figuring out how to make the build environment work with Vim. 



-Dan

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment