Home > Blockchain >  How to use other languages (e. g. Russian) in VSCode Vim Ubuntu without changing layout by self?
How to use other languages (e. g. Russian) in VSCode Vim Ubuntu without changing layout by self?

Time:11-17

I tried ibus and xkb-switch (from im-select), but these don't work for me.

CodePudding user response:

I solved this problem by adding to VSCode settings.json:

{
    "vim.autoSwitchInputMethod.enable": true,
    "vim.autoSwitchInputMethod.defaultIM": "0",
    "vim.autoSwitchInputMethod.switchIMCmd": "/usr/bin/gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval \"imports.ui.status.keyboard.getInputSourceManager().inputSources[{im}].activate()\"",
    "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/bin/gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval \"imports.ui.status.keyboard.getInputSourceManager().currentSource.index\" | cut -d\"'\" -f2"
}

Default input method (in settings "vim.autoSwitchInputMethod.defaultIM") can be obtained by the last command in the list above (if type this command in terminal)

  • Related