I am trying out Vim as a C++ ide using puremourning/vimspector and ycm-core/YouCompleteMe plugins as the debugger/launcher/error checker, etc. My project directory is thus:
--myproject\
----src\
main.cpp (includes maininclude in include folder)
----include\
maininclude.h (included in main in src folder)
----.vscode\ (all vscode .json files reside inside this folder)
tasks.json
launch.json
Makefile
Makefile-Debug
Makefile-impl
Makefile-variables
----.vim\ (all vim ide related files ideally should reside here)
.ycm_extra_conf.py
Makefile
Makefile-Debug
Makefile-impl
Makefile-variables
.vimspector.json
Is there a way to have
vimspectorreference the.vimspector.jsonfile from inside the.vim\folder instead of directly belowmyproject\folder? For instance, is there a setting equivalent to the following (which works forYouCompleteMe) that should be placed inside of.vimrc?let g:ycm_global_ycm_extra_conf ='./.vim/.ycm_extra_conf.py'which changes the default location from where this configuration file is read ?
The reason is that I would like all vim-ide related files to be fully contained within .vim\ folder and not in the outside project folder.
.vimspector.jsonfile seems similar in content to.vscode/launch.jsonfile. My.vscode/launch.jsonfile has an option of apreLaunchTaskwhich builds the project.
"preLaunchTask": "lindbgbuild",
This build task does nothing other than the following:
"command": "make",
"args": ["CONF=Debug", "-C", "./.vscode"],
Also, within VSCode, building automatically saves any source code files that have changed but not yet saved. The net effect of all of this is that within VSCode, it is straightforward to change a file, setup a breakpoint and run it (if there are errors, in this process, VSCode automatically indicates where the error is and the debug launch is aborted) to hit that breakpoint with a single button press (F5). Note the -C ./.vscode option. This allows me to start VSCode from myproject\ folder and accesses the makefiles within myproject\.vscode\ folder. All of this is highly convenient.
Is a similar feature available in vimspector that automatically saves the file, if changed, builds it using make from within .vim\ folder Makefiles, and then launches the debugger until the breakpoint is hit? As of now, because of my inability to use this feature (assuming it exists), I am having to separately navitage to \myproject\.vim\ and issue make CONF=Debug, then go back into Vim and then hit F5.