Open macintacos opened 4 years ago
That's interested idea!
Again, I am just dumping my brain here. Here are a few things I am thinking
settings.json
to store bindings allows people to sync settings across machines/Codespaces with the upcoming Settings Sync, file url might not work across machines.settings.json
and update accordingly with vscode's API. Using file url might mean that we need to track file changes or may require a reload of the instance when the file is changed for it to be effective.whichkey.bindings
, which allows user to completely change the binding from scratch..vimrc
Speaking personally of course, I don't particularly care about syncing or codespaces. I have only one machine I care about, although I totally get your point; just wouldn't be applicable to me. Completely understand that you wouldn't want to implement this without thinking about those aspects though.
As long as we're just spitting out ideas, one thing that could be interesting is just specifying a glob pattern and also accepting arbitrary URLs, similar to how the VSCode YAML extension does it (check out the "Associating a schema to a glob pattern via yaml.schemas" section in their README here to understand what I mean). Even if you could just specify regex, regex could handle a schema file being in multiple places at once, and could also allow you to split out configurations across multiple files. Implementing that could also potentially handle specifying certain keybindings only when a certain file type is active, which I mean to me is just 🤯.
Although obviously that'd probably complicate the code in this project quite a bit, it's interesting to at least theorize about.
I've been thinking about this for a bit, and I wonder if it would be possible (and if so, a good idea) to allow settings extensions to contribute bindings?
That'd mean:
@The-Compiler This seems to relate to the Layer issue. I replied some of my thoughts at https://github.com/VSpaceCode/VSpaceCode/issues/199#issuecomment-859274377
I'm working on adding a lot of chord to my keymap set for VSpaceCode (which I definitely plan on sharing when I'm done). I'm just about halfway done, and one thing that I've already noticed is that my
settings.json
file is enormous now. For context, I've added about 40 or so menu items, which has resulted in roughly 450 new lines in mysettings.json
file.As you can imagine, this is making my
settings.json
file a bit unwieldy at this point. I think it'd be a lot cleaner if I could just specify a variable likevspacecode.bindingOverridesFile
and specify the full path to that file, and thenvscode-which-key
just expands that.