VSCodeVim / VSCodeVim/Vim

Bind Ctrl-\ to change keyboard layout

Open
#7,641 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.