Open source alternative for MS Visual Studio, powered by cl compiler. Featuring no project files, simple build process, "soft" and "hard" debuggers and mingw-like error output styling.
Just double-click the msvc_build.cmd file. Yep. As easy as this. Well, that is, if you have your Visual Studio installed, of course. And if your VS vcvars64.bat file is located at this path:
set "bat_dir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
If not, first of all, make sure the Visual Studio is installed. In the setup wizard you will see a huge list of useless features and bloat. Only the C++ build tools are actually needed. Switch to Individual components and try to find this in the humongous list:
MSVC vXXX - VS 202X C++ x64/x86 build tools (Latest)
After this you will have to merely locate the vcvars64.bat file and copy-paste the path to it into msvc_build.cmd. Then just launch it and wait until it does all the job for you. Yes, you don't even need to install or open the Visual Studio IDE itself. Ever.
-
Add
Notepad++.exeto your systemPATHvariable. -
Install
Customize Toolbarplugin:
-
Use
appdata/roaming/npp/shortcuts.xmlin this repo as an example, you can integrate all or only some of the shortcuts. Most of them are self-explanatory. The most important being:Build C++ file- to actually be able to build.cppfiles,Build all libs- useful for rebuilding many static libraries in defined order,Add keywords- usesnppautos.exeto override defaultcpp.xmlautocompletion file with your custom functions placed in thenpp_autos.h(you might want to back up defaultcpp.xml). What macros do:REGEX_MARK_ESCAPED_CH- marks escaped characters (\n\r\xetc.)FUNCS_TO_DECLS- converts function definitions to declarationsFUNCS_TO_DEFINS- converts function declarations to definitionsPATH_TO_STR_LIT- converts windows path to C++ string literalHTML_CODE_ENTAG- encases selected text into HTML<code>tagSTR_LITERAL- encases string literal intoL()WSTR_LITERAL- encases wide string literal intoWL()
-
Copy the contents of
appdata/roaming/npp/plugins/configrepo folder into yourplugins/configfolder located inC:\Users\<USERNAME>\AppData\Roaming\Notepad++\plugins\config. Relaunch Notepad++ for changes to take effect. -
Install Build Tools for Visual Studio 2022 (YES, you don't even need the bloated IDE itself!) or if you have Visual Studio already installed, skip.
-
Set up environment variables, type in your Start menu:
x64 Native Tools Command Prompt for VS 2022, launch it. If nothing is found, you will have to go digging in yourProgram Filesdirectory to findC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat. -
Copy and paste following lines into the console. After each command, Ctrl+V the result into your
cmd/msvc_build.cmd(remember,msvc_build.cmdlocated in the root of this repo is version specifically designed for building git repo and has no iteration with Notepad++) file, after the@echo offline:
echo set "PATH=%PATH%" | clip
echo set "INCLUDE=%INCLUDE%" | clip
echo set "LIB=%LIB%" | clip
echo set "LIBPATH=%LIBPATH%" | clip
-
Alternatively, you can set this environmental variable permanently, if you want (should result in a few milliseconds faster builds). Press Win+R, enter
rundll32.exe sysdm.cpl,EditEnvironmentVariables. In the bottom sub-window locatePathvariable and then add extra variables that was injected by the Visual Studio in the correct order (for this, compare your originalPathto one you got from the VS console). Also addINCLUDE,LIBandLIBPATHvariables separately fromPath. VS documentation does not encourage this, but I never ran into any issues in a long time of using this strategy. -
In the
cmd/msvc_build.cmdmodify this lines to lead to your custom.hand.libfiles so that you can use them for a program in any folder:
set "inc_dir=/I D:\P\MT\"
set "lib_dir=/LIBPATH:D:\P\MT\"
-
Set up your folder structure to make it the most convenient to use this IDE. I can give you and example of my own structure.
Pcontains all the programs I ever created in one place.MT(Micro Tests) folder contains loads of my tiny programs/utilities/libraries that could be used by any "big" program inP.msvc_build.cmdfile can be placed intoMT\cmdfolder. You can also addMT\extfolder and place all the external (not written by you personally) libraries/headers there, then have some wrapper headers in yourMTfolder that will include all the external headers/libs. For example,MT\ext\curl\curl.hthen in yourMTfolder you can have wrapper headercurl.hthat will have#include "ext\curl\curl.h"this way you will never ever have to worry about changing your include/lib directory ever again. -
It's super easy, barely an inconvenience to add icon and/or manifest to your program, fast. All you have to do, is to create
res\ico/res\manifestfolder in your program's root folder and put icon/manifest there that will exactly match the program's .cpp file name (i.e.foo.cpp>foo.ico/foo.manifest). The CMD script will take care of all the annoying parts of actually generating and compiling and linking resource files. Oh, and you can putmain.ico/main.manifestin theres\ico/res\manifestfolder. This will get used by default for all your programs without any dedicatedprogram_name.ico/program_name.manifestfiles. You can also createres\rcfolder and put customprogram_name.rcfiles there. If such a file will be detected, it will be used instead of generating automatic.rcfile. -
cmd/msvc_build.cmduses 3 little utilities:errlogkill,eline2nppandvcstyle. You should place them in the folder included intoPATHvariable, or hardcore absolute paths to them in thecmd/msvc_build.cmd. Whaterrlogkilldoes, it, basically, just sends Windows message to the Notepad++ that forces it to save current file and it also sends termination messages to the error/warning console windows. This frees you from having to constantly remember to SAVE THE FILE after you quickly corrected some error, which greatly aids workflow. All you have to do is press theBuild CPP filebutton.eline2nppis responsible for automatically jumping to the first or clicked error/warning, and highlighting it in Notepad++.vcstyleis a pipe that styles almost unreadable rawcl.exeoutput intomingw-like colour coded goodness. -
You can integrate some or all of the custom context menu entries. Use
appdata/roaming/npp/contextMenuand copy entries to your own. You can also copy someuserDefineLang-s from there. It has styling for.codASM output files,.logfiles and markdown. -
Optionally, you can install the theme I use too:
appdata/roaming/npp/themes/VS2019-Dark.xml. It was support for some of the custom types/instructions I created. The theme is based on VS2019-Dark-Npp by hellon8. -
Last but not least, install
sdppplugin. It is very important as it adds many useful features but also serves as communication link between Notepad++ andeline2nppandsddbdebugging library. Just copysdpp.dllinto your Notepad++plugins_folder\sdpp\sdpp.dlland restart NPP. -
Profit! You are ready for rapid C/C++ development in Notepad++!
There is no project files. No need for them at all. You can control compilation of individual programs easily from the source file itself by including comment in the top of your source file like this:
// CONSOLE DBG NOPT
CONSOLE - compile program as console application (default - SUBSYSTEM:WINDOWS)
DSEH - disable C++ STD SEH handling (if you need to __try() __except() in functions with objects)
NOPT - disable all optimisations
NW - disable all warnings (default - wall)
SLIB - do not link, assemble into static library
DLIB - compile as dynamic library (DLL)
DLLIE - produce DLL export and import libraries (default - only .dll is produced)
ASM - instead of compiling to .exe file, open MASM code created by the compiler in Notepad++ (aka. your own Compiler Explorer)
DBG - compile in debug mode and launch resulting executable with sddbg debugger attached
NLAUNCH - just compile and link, no automatic launch
EPMAIN - use main instead of wmain as an entry point
The idea here is like this - cmd/msvc_build.cmd is your base "master" project file script that is used in all the programs. And each program tweaks it's behaviour from it's own source code. This avoids the need to have useless files lying around and makes all your projects consistent.
Note: building single .exe / .dll from multiple .cpp files is currently not supported. I didn't had any need for this feature yet, but I plan to add it in the future, when the need arises.


