VSCodeVim / VSCodeVim/Vim

`<C-Left>` and `<C-Right>` remapping in insert mode not working

Open
#6,333 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Unable to use ctrl+arrowLeft and ctrl+arrowRight to remap some actions in insert mode.

I have this settings.json:

{
    "omnisharp.path": "latest",
    "omnisharp.useGlobalMono": "always",
    "vim.useCtrlKeys": true,
    "vim.handleKeys": {
        "<C-Right>": true,
        "<C-Left>": true
    },
    "vim.normalModeKeyBindings": [
        {
            "before": ["<C-Up>"],
            "after": ["5","k"]
        },
        {
            "before": ["<C-Down>"],
            "after": ["5","j"]
        }
    ],
    "vim.insertModeKeyBindings": [
        {
            "before": ["<C-Left>"],
            "after": ["<ESC>","d","b","<Del>","i"]
        },
        {
            "before": ["<C-Right>"],
            "after": ["<ESC>","l","d","e","i"]
        }
    ]
}

I would like to delete words using ctrl+arrowLeft and ctrl+arrowRight.
Works well ["<C-Up>"] and ["<C-Down>"] keybindings in normal mode to move up and down by 5 rows, but the default behaviour is applied for ["<C-Left>"] and ["<C-Right>"] (move cursor to the beginning/end of the adjacent word).

I'm not able to attach log output, because setting the logging level as suggested in the documentation, not print me any error or warning messages.

  • Extension (VsCodeVim) version: 1.19.1
  • VsCode version: 1.54.3
  • OS: Ubuntu 18.04.5, Linux x64 5.4.0-67-generic

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 behavior with the reported settings.json, focusing on vim.handleKeys and vim.insertModeKeyBindings for and . Compare the working normal-mode bindings with insert-mode handling in the VSCodeVim extension. Done means both insert-mode keybindings invoke their configured actions instead of the default cursor movement.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.