I have been using Vim for about 2 years on my personal C++ project on Ubuntu with great success. I build using
make, as my build system. In vim, I can build the project without problem using
:make. My personal project has about 200 files.
In my job, the project I'm working on has 7 millions C++ files (over 35k files) and has been, from day one, a project build for Microsoft Windows, using Visual Studio. I have installed
vim at my job, trying to use it to code. So far, I have not been able to "integrate" it successfully to my workflow for two main reasons:
Finding files is ridiculously slow: on my personal project, using
:findis instantaneous. I can use wildcard without problems, I get nice fuzzy file search right out of the box. For finding expressions, I can use
vimgrepand results come out fast. On my job's code base, finding a file or an expression can take from couple seconds to 30+ seconds. We have "a lot" of nested directories.
I'm unable to make
:makework appropriately: I have tried using
msbuild(see here for example), with no success. Building a single file (as
Ctrl+F7does within Visual Studio) would suffice, but I can't seem to make it work.
If I could make work both 1. and 2., I would be satisfied. I could do about 90% of my editing/compiling from
vim. Is there a way to achieve this?
- I have used
VsVimfor some time. It is not so bad (in fact it's pretty great) but is not enough for me. Some options are missing (the vim help, for instance).
- We work on Windows 10/11 and use Visual Studio 2022.
- For the 2. I have tried a lot of things. The last thing I tried is this:
The command works in the terminal (it builds the solution and I see the output). From
au FileType cpp set makeprg=devenv\ MySolution.sln\ /build\ "Debug|x64" au FileType cpp set errorformat=\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %m
vim. When I type
:makenothing seems to happen and I get the following output in the terminal:
Then vim "hangs" and if I go check the specified
C:\WINDOWS\system32\cmd.exe /c (devenv MySolution.sln /build ^>C:\Users\johndoe\AppData\Local\Temp\VIe1D01.tmp 2^>^&1)
tmpfile, I see the build output. In my personal project, I see the build output directly in Vim.