Bind Ctrl-\ to change keyboard layout
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
I use vim in terminal environment without gui and there I use the standard key binding <Ctrl-\> to change layout.
But in VS Code with VIM extension in Linux I use my standard gui keyboard switch with suggested
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/xkb-switch",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/xkb-switch -s {im}",
"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "us",
I spend a lot of time in both environments and it's painful to remember when use what. I tried this in vs code keybindings.json but it was unsuccessful:
{
"key": "ctrl+\\",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "/usr/local/bin/xkb-switch -n"}
}
Is it possible to bind somehow <Ctrl-\> to the desired command?
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 VS Code keybindings.json example and the workbench.action.terminal.sendSequence entry point described in the issue. Check whether Ctrl-\ is recognized and whether that command can invoke the requested xkb-switch action alongside the Vim extension. Done means establishing a supported binding or documenting the precise limitation and required configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100