VSCodeVim / VSCodeVim/Vim

`<C-o>` doesn't work in Replace mode

Open
#7,897 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Using Ctrl-O (<C-o>) in replace mode seems to do nothing, instead immediately printing out the keys that follow.
In vim this mapping works like the insert mode mapping:

CTRL-O execute one command, return to Insert mode i_CTRL-O

To Reproduce
Steps to reproduce the behavior:

  1. Add the following to settings.json:
    "vim.insertModeKeyBindingsNonRecursive": [
         { "before": ["<down>"], "after": ["<C-o>", "g", "j"] },
         { "before": ["<up>"], "after": ["<C-o>", "g", "k"] },
    ]
    
  2. Open any file in the editor
  3. Insert some text if not already present
  4. Place the text caret on a line with text on it
  5. Press Shift-R, which transitions vim into REPLACE mode
  6. Press the Up or Down arrow
  7. Watch as gj or gk is inserted into the document, instead of moving the caret

Expected behavior
Step 7 should result in the text caret being moved up or down instead of inserting gj/gk.

Environment (please complete the following information):

  • Extension Name: vim
  • Extension Version: 1.23.2
  • OS Version: Darwin arm64 21.3.0
  • VS Code version: 1.70.0

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 reproducing the issue with the settings.json insertModeKeyBindingsNonRecursive mappings, then trace the Replace mode handling for and key sequences such as gj and gk. Done means the Up and Down mappings move the caret in Replace mode without inserting those characters, while the existing Insert mode behavior remains intact.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.