Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Allow arbitrary dir for per-project vimspector config. #275

Open
TryerGit opened this issue Oct 9, 2020 · 8 comments
Labels
enhancement New feature or request needs votes +1 the issue or vote on the trollo card if you would like this
Projects

Comments

@TryerGit
Copy link

TryerGit commented Oct 9, 2020

Hello,

At present, I have a project structure which looks like so:

--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

I would like to alternate between using VSCode to debug my project or else fire up VIM. Starting VSCode can be done by typing "code ." directly in the project folder itself and it accesses project and VSCode specific configuration files from within .vscode\ subfolder.

Is something similar possible in vimspector? That is, can vimspector refer to the .vimspector.json file from within the .vim\ folder so that the project folder myproject\ is clean of files? I would like to open this project by starting vim from the myproject\ folder. As of now, from the documentation I have read, it appears that .vimspector.json necessarily has to be placed in the myproject\ folder.

PS: I asked this also in SO.

@puremourning
Copy link
Owner

PS: I asked this also in SO.

I do not monitor stack overflow.

Is something similar possible in vimspector?

no, sorry and I'm not likely to change it. there are already many ways to configure this stuff and adding more is a bit painful to maintain and test.

FWIW, .ycm_extra_conf.py will not work in .vim folder either.

@TryerGit
Copy link
Author

TryerGit commented Oct 9, 2020

Thanks for the quick response!

Hmm...so I think I will place the .vimspector.json file within .vim\ folder and start vim from within .vim\ folder. That way my project folder remains clean.

Regarding ycm, it works in my case placing it inside a .vim\ folder. When I fired up vim from within the project folder (so that src\ , include\ , .vim\ and .vimspector.json are at the same level), I had

let g:ycm_global_ycm_extra_conf = './.vim/.ycm_extra_conf.py' and this .py file had as contents

def Settings( **kwargs):
return {
'flags': [ '-I./include' ],
}

and ycm was able to "find" maininclude.h from within src/main.cpp

@puremourning
Copy link
Owner

let g:ycm_global_ycm_extra_conf = './.vim/.ycm_extra_conf.py' and this .py file had as contents

Oh boy. I don't think we intended for that to work, but I guess it does.

Perhaps vimspector could have a similar option? I dunno really. seems hacky.

If you were to make a proposal and send a PR to do this, add tests and documentation, I would probably still come down on the side of this is too niche a use-case to warrant the complexity :/

But if others would like this then they can vote on this issue by +1'ing it.

@puremourning puremourning changed the title Is there a way to place .vimspector.json within a subfolder and not the main project folder? [Feature Request]: Allow arbitrary dir for per-project vimspector config. Oct 9, 2020
@puremourning puremourning added enhancement New feature or request needs votes +1 the issue or vote on the trollo card if you would like this labels Oct 9, 2020
@TryerGit
Copy link
Author

TryerGit commented Oct 9, 2020

Hmm...what I did was certainly not my own hacking. It seems to be well-supported by ycm itself.

Please see "Configuring through Vim options" section of https://github.com/ycm-core/YouCompleteMe

@puremourning
Copy link
Owner

Please see "Configuring through Vim options" section of https://github.com/ycm-core/YouCompleteMe

That's using a single global path, which is the intention of the g:ycm_global_extra_conf option. Trust me I'm the primary maintainer of YCM

@TryerGit
Copy link
Author

TryerGit commented Oct 9, 2020

Fair enough puremourning :-)

@andwilley
Copy link
Contributor

Apologies if this already exists, but I think a related feature would be the ability to provide an arbitrary directory for filetype specific configs outside of the vimspector installation directory. I think most of us don't version control our plugins, so I would have to duplicate this filetype specific config each time I install vimspector. If I could provide something like let g:vimspector_filetype_specific_config_dir='expand(~/.vim/.vimspector/filetypeconfigs)' I could version control these filetype directories and .json files separately from the plugin itself.

Lmk if this is already available, infeasible, or different enough to warrant another issue.

@puremourning
Copy link
Owner

Use g:vimspector_base_dir for that. My configs here for example https://github.com/puremourning/.vim-mac/tree/master/vimspector-conf

@puremourning puremourning added this to To do in QoL Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs votes +1 the issue or vote on the trollo card if you would like this
Projects
QoL
To do
Development

No branches or pull requests

3 participants