VSCodeVim / VSCodeVim/Vim

[But Report] im-select messes vim-surround

Open
#6,658 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/plugin kind/bug
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Environment

  • macOS: 10.14.6
  • VSCode: 1.56.2
  • VSCodeVim: 1.20.3
  • im: com.apple.keylayout.US in Normal, com.sogou.inputmethod.sogou.pinyin in Insert

To Reproduce
Steps to reproduce the behavior:

  1. Setting im-select
  2. Switch to com.sogou.inputmethod.sogou.pinyin in Insert mode, exit to Normal mode and switch to com.apple.keylayout.US
  3. In Normal mode, do surround ysiw, the back quote is interpreted as ·by thecom.sogou.inputmethod.sogou.pinyin`

The same problem happens on other characters like ', ".

Similar issues has been report in #3699, #4536.

In #3699, C-[ is interpreted C-【. This is avoided with an ugly fix by mapping C-【 to C-[ in Insert mode. But for me, mapping for ', " is unacceptable. This is not combination keys, just normal quotes symbols.

Currently I find a way to always switch back to com.apple.keylayout.US in Insert mode. This is what exactly #4536 required exactly.

  "vim.autoSwitchInputMethod.enable": true,
  "vim.autoSwitchInputMethod.defaultIM": "com.apple.keylayout.US",
  "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/im-select",
  "vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/im-select com.apple.keylayout.US {im}",

This is kind of hack, cause im-select on macOS accept multi values but only the 1st is used.

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 by tracing the autoSwitchInputMethod settings and the im-select command configuration shown in the issue, then reproduce the quote-key behavior on macOS with the listed input methods. Done means Normal-mode surround commands interpret back quotes, apostrophes, and quotation marks correctly without requiring the reported mapping hack.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.