Is "<leader> key" supposed to be able to call keybindings in keybindings.json?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Everything is up to date
I have a handy keybinding that opens the file explorer and closes it if its active (its a hack because there's no toggleExporer command built in). I had to put this in keybindings.json because of the conditional ("when")
keybindings.json
{
"key": "ctrl+'",
"command": "workbench.view.explorer"
},
{
"key": "ctrl+'",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.explorer'"
}
I'm having no luck being able to call it using a leader key
{
"before": ["leader", "d"],
"after": ["C-'"]
},
However I have no problems with using the leader key with remapping vim keys and calling vscode actions:
{
"before": ["leader", "d"],
"after": ["C-f"]
},
{
"before": ["leader", "s"],
"commands": ["workbench.action.files.save"]
},
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the keybindings.json examples and compare the leader mapping that triggers C-' with the mappings that trigger C-f or a VS Code command. Trace how leader mappings dispatch keybindings and define done as making the conditional explorer bindings callable through the leader key, with coverage for the reported mapping behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100