I have been using Vim for about 2 years on my personal C++ project on Ubuntu with great success. I build using g++
and 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
:find
is instantaneous. I can use wildcard without problems, I get nice fuzzy file search right out of the box. For finding expressions, I can usegrep
orvimgrep
and 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
:make
work appropriately: I have tried usingmakeprg
anddenvenv
andmsbuild
(see here for example), with no success. Building a single file (asCtrl+F7
does 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?
Notes:
- I have used
VsVim
for 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). Fromau 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:make
nothing seems to happen and I get the following output in the terminal:
Then vim "hangs" and if I go check the specifiedC:\WINDOWS\system32\cmd.exe /c (devenv MySolution.sln /build ^>C:\Users\johndoe\AppData\Local\Temp\VIe1D01.tmp 2^>^&1)
tmp
file, I see the build output. In my personal project, I see the build output directly in Vim.
devenv
and/ormsbuild
work for you outside of Vim?:setlocal path?
for a file from which:find
is slow; it wasn't designed to be used for fuzzy-finding, so if you have lots of files andpath=**/*
, it can be slow.:make
doesn't work? Are you getting an error message? What happens if you exeucte it?