[But Report] im-select messes vim-surround
Nobody has claimed this yet.
- 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.USin Normal,com.sogou.inputmethod.sogou.pinyinin Insert
To Reproduce
Steps to reproduce the behavior:
- Setting
im-select - Switch to
com.sogou.inputmethod.sogou.pinyinin Insert mode, exit to Normal mode and switch tocom.apple.keylayout.US - 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
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 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