VSCodeVim / VSCodeVim/Vim

Langmap always remaps in normal mode

Open
#9,432 0 comments 2 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

Describe the bug
I have a langmap from Cyrillic to English like that:

"vim.langmap": "ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz"

If I want to replace a symbol using vim's r command, the replacement symbol always appears to be Cyrillic, regardless of what my current language is. Same goes for searching for characters with f command.

To Reproduce
Steps to reproduce the behavior:

  1. Enable langmap.
  2. Type some text like 123.
  3. With English layout press r twice with cursor on the first symbol. The result would be к23 instead of r23.

Expected behavior
Replacement or searching for letters works with respect to current layout.

Screenshots
Log from typing 123 and then trying rr on the first character:

2025-01-11 15:22:38.543 [info] Configuration changed
2025-01-11 15:22:44.789 [debug] 0 errors found with vim configuration
2025-01-11 15:22:44.790 [debug] Start
2025-01-11 15:22:44.790 [debug] Status bar: -- NORMAL --
2025-01-11 15:22:44.821 [debug] Handling key: <extensionenable>
2025-01-11 15:22:44.826 [debug] Finish.
2025-01-11 15:22:45.236 [info] Configuration changed
2025-01-11 15:22:45.237 [debug] 0 errors found with vim configuration
2025-01-11 15:22:45.431 [info] Configuration changed
2025-01-11 15:22:45.432 [debug] 0 errors found with vim configuration
2025-01-11 15:22:47.512 [info] Active editor: output:tasks
2025-01-11 15:22:49.581 [info] tasks closed
2025-01-11 15:22:49.581 [info] Active editor: untitled:Untitled-1
2025-01-11 15:22:51.195 [debug] Handling key: i
2025-01-11 15:22:51.199 [debug] Status bar: -- INSERT --
2025-01-11 15:22:52.947 [debug] Handling key: 1
2025-01-11 15:22:52.948 [debug] Adding Transformation {"type":"insertTextVSCode","text":"1","isMultiCursor":false}
2025-01-11 15:22:52.953 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:22:52.958 [debug] Set nextStepStartPosition to [0, 0]
2025-01-11 15:22:54.063 [debug] Handling key: 2
2025-01-11 15:22:54.064 [debug] Adding Transformation {"type":"insertTextVSCode","text":"2","isMultiCursor":false}
2025-01-11 15:22:54.068 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:22:54.383 [debug] Handling key: 3
2025-01-11 15:22:54.384 [debug] Adding Transformation {"type":"insertTextVSCode","text":"3","isMultiCursor":false}
2025-01-11 15:22:54.386 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:22:56.833 [debug] Handling key: <Esc>
2025-01-11 15:22:56.836 [debug] Finished history step with 1 change(s)
2025-01-11 15:22:56.837 [debug] Status bar: -- NORMAL --
2025-01-11 15:22:59.783 [debug] Handling key: 0
2025-01-11 15:23:01.577 [debug] Handling key: r
2025-01-11 15:23:01.888 [debug] Handling key: r
2025-01-11 15:23:01.888 [debug] Adding Transformation {"type":"replaceText","text":"к","range":[{"line":0,"character":0},{"line":0,"character":1}],"diff":{"type":1,"line":0,"character":0}}
2025-01-11 15:23:01.892 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:23:01.894 [debug] Set nextStepStartPosition to [0, 0]
2025-01-11 15:23:01.894 [debug] Finished history step with 1 change(s)

Environment:

  • Extension (VsCodeVim) version: 1.29.0
  • VSCode version: 1.96.2
  • OS: Linux (EndeavourOS, kernel 6.12.8)

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

The issue identifies the vim.langmap setting and normal-mode r and f commands as the entry points; reproduce the Cyrillic replacement and search behavior with the supplied mapping. Trace langmap handling for these commands and verify that replacement and search respect the current layout without regressing other mappings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.